win32 compilation flag improvements

This commit is contained in:
Wenzel Jakob 2015-09-01 21:38:20 +02:00
parent 2b0339f44e
commit 02f770d06c

View File

@ -69,7 +69,9 @@ set_target_properties(example PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOUR
if (WIN32) if (WIN32)
if (MSVC) if (MSVC)
# Enforce size-based optimization and link time code generation on MSVC (~30% smaller binaries in experiments) # 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") set_target_properties(example PROPERTIES LINK_FLAGS "/LTCG")
endif() endif()