From 36ae3e5fec80cdc238586d11253c3c5064285b59 Mon Sep 17 00:00:00 2001 From: Remy Marquis Date: Sun, 15 Jul 2018 17:34:25 +0200 Subject: [PATCH] libs: adjusted FreeType for windows compilation --- freetype/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/freetype/CMakeLists.txt b/freetype/CMakeLists.txt index ad8ded0b..8ac234da 100644 --- a/freetype/CMakeLists.txt +++ b/freetype/CMakeLists.txt @@ -318,6 +318,24 @@ else () list(APPEND BASE_SRCS src/base/ftdebug.c) endif () +if(MSVC) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHsc /O2") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /EHa /W3") + + set(CompilerFlags + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + ) + + foreach(CompilerFlag ${CompilerFlags}) + string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") + endforeach() +endif(MSVC) + if (BUILD_FRAMEWORK) list(APPEND BASE_SRCS builds/mac/freetype-Info.plist) endif ()