From b681ec652754aab8a4e6a36ea6f43a4e48840e9e Mon Sep 17 00:00:00 2001 From: Luminiscental <16429289+Luminiscental@users.noreply.github.com> Date: Mon, 15 Feb 2021 15:13:18 +0000 Subject: [PATCH] Guard library pragma comments out of cmake builds (#120) --- CMakeLists.txt | 2 ++ ext/import-font.cpp | 2 +- ext/resolve-shape-geometry.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8422328..a8012cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,8 @@ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ) +target_compile_definitions(msdfgen-ext PUBLIC MSDFGEN_CMAKE_BUILD) + if(MSDFGEN_USE_CPP11) target_compile_features(msdfgen-ext PUBLIC cxx_std_11) target_compile_definitions(msdfgen-ext PUBLIC MSDFGEN_USE_CPP11) diff --git a/ext/import-font.cpp b/ext/import-font.cpp index 8f23620..966bc00 100644 --- a/ext/import-font.cpp +++ b/ext/import-font.cpp @@ -7,7 +7,7 @@ #include FT_FREETYPE_H #include FT_OUTLINE_H -#ifdef _WIN32 +#if defined(_WIN32) && !defined(MSDFGEN_CMAKE_BUILD) #pragma comment(lib, "freetype.lib") #endif diff --git a/ext/resolve-shape-geometry.cpp b/ext/resolve-shape-geometry.cpp index 12e45a9..657018b 100644 --- a/ext/resolve-shape-geometry.cpp +++ b/ext/resolve-shape-geometry.cpp @@ -9,7 +9,7 @@ #include "../core/edge-segments.h" #include "../core/Contour.h" -#ifdef _WIN32 +#if defined(_WIN32) && !defined(MSDFGEN_CMAKE_BUILD) #pragma comment(lib, "skia.lib") #endif