From ecc514f11b77690bc1d2d782c8f00a9b045b4f4f Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Tue, 12 May 2015 20:38:56 +0200 Subject: [PATCH] Build and link gmp correctly on MSVC Also optimize json's library --- src/gmp/CMakeLists.txt | 5 ++++- src/json/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gmp/CMakeLists.txt b/src/gmp/CMakeLists.txt index b8a56543f..96ae8191d 100644 --- a/src/gmp/CMakeLists.txt +++ b/src/gmp/CMakeLists.txt @@ -1,4 +1,7 @@ -add_library(gmp mini-gmp.c) +if(MSVC) + set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") +endif() +add_library(gmp mini-gmp.c) target_link_libraries(gmp) diff --git a/src/json/CMakeLists.txt b/src/json/CMakeLists.txt index de99c7f0c..9056e4b6d 100644 --- a/src/json/CMakeLists.txt +++ b/src/json/CMakeLists.txt @@ -1,5 +1,5 @@ if(MSVC) - set(CMAKE_CXX_FLAGS_RELEASE "/MT") + set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") endif() add_library(jsoncpp jsoncpp.cpp) -- 2.25.1