From 02f770d06cf3f169a7bac15e37403dc38881f264 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 1 Sep 2015 21:38:20 +0200 Subject: [PATCH] win32 compilation flag improvements --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 913070802..71796165e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,9 @@ set_target_properties(example PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOUR if (WIN32) if (MSVC) # Enforce size-based optimization and link time code generation on MSVC (~30% smaller binaries in experiments) - set_target_properties(example PROPERTIES COMPILE_FLAGS "/Os /GL") + # /bigobj is needed for bigger binding projects due to the limit to 64k addressable sections + # /MP enables multithreaded builds + set_target_properties(example PROPERTIES COMPILE_FLAGS "/Os /GL /MP /bigobj") set_target_properties(example PROPERTIES LINK_FLAGS "/LTCG") endif()