mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-18 06:30:54 +00:00
improve cmake windows debug configuration (fixes #77)
This commit is contained in:
parent
fa92f6796f
commit
518cf721d9
@ -129,12 +129,17 @@ endforeach()
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
# Enforce size-based optimization and link time code generation
|
# /bigobj is needed for bigger binding projects due to the limit to 64k
|
||||||
# on MSVC (~30% smaller binaries in experiments). /bigobj is needed
|
# addressable sections. /MP enables multithreaded builds (relevant when
|
||||||
# for bigger binding projects due to the limit to 64k addressable sections
|
# there are many files).
|
||||||
# /MP enables multithreaded builds (relevant when there are many files).
|
set_target_properties(example PROPERTIES COMPILE_FLAGS "/MP /bigobj ")
|
||||||
set_target_properties(example PROPERTIES COMPILE_FLAGS "/Os /GL /MP /bigobj")
|
|
||||||
set_target_properties(example PROPERTIES LINK_FLAGS "/LTCG")
|
if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
|
||||||
|
# Enforce size-based optimization and link time code generation on MSVC
|
||||||
|
# (~30% smaller binaries in experiments).
|
||||||
|
set_target_properties(example APPEND_STRING PROPERTY COMPILE_FLAGS "/Os /GL ")
|
||||||
|
set_target_properties(example APPEND_STRING PROPERTY LINK_FLAGS "/LTCG ")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# .PYD file extension on Windows
|
# .PYD file extension on Windows
|
||||||
|
@ -84,12 +84,17 @@ and that the pybind11 repository is located in a subdirectory named :file:`pybin
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
# Enforce size-based optimization and link time code generation
|
# /bigobj is needed for bigger binding projects due to the limit to 64k
|
||||||
# on MSVC (~30% smaller binaries in experiments). /bigobj is needed
|
# addressable sections. /MP enables multithreaded builds (relevant when
|
||||||
# for bigger binding projects due to the limit to 64k addressable sections
|
# there are many files).
|
||||||
# /MP enables multithreaded builds (relevant when there are many files).
|
set_target_properties(example PROPERTIES COMPILE_FLAGS "/MP /bigobj ")
|
||||||
set_target_properties(example PROPERTIES COMPILE_FLAGS "/Os /GL /MP /bigobj")
|
|
||||||
set_target_properties(example PROPERTIES LINK_FLAGS "/LTCG")
|
if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
|
||||||
|
# Enforce size-based optimization and link time code generation on MSVC
|
||||||
|
# (~30% smaller binaries in experiments).
|
||||||
|
set_target_properties(example APPEND_STRING PROPERTY COMPILE_FLAGS "/Os /GL ")
|
||||||
|
set_target_properties(example APPEND_STRING PROPERTY LINK_FLAGS "/LTCG ")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# .PYD file extension on Windows
|
# .PYD file extension on Windows
|
||||||
|
Loading…
Reference in New Issue
Block a user