mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
win32 compilation flag improvements
This commit is contained in:
parent
2b0339f44e
commit
02f770d06c
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user