Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
bdd11030
"tests/test_operator_overloading.cpp" did not exist on "8f4eb006901553ccfa010b75660f979ab1ef31a4"
Commit
bdd11030
authored
May 01, 2016
by
Wenzel Jakob
Browse files
minor cmake improvements on windows
parent
6fb48490
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
22 deletions
+26
-22
CMakeLists.txt
CMakeLists.txt
+13
-11
docs/cmake.rst
docs/cmake.rst
+13
-11
No files found.
CMakeLists.txt
View file @
bdd11030
...
...
@@ -148,17 +148,19 @@ endforeach()
if
(
WIN32
)
if
(
MSVC
)
# /bigobj is needed for bigger binding projects due to the limit to 64k
# addressable sections. /MP enables multithreaded builds (relevant when
# there are many files).
set_target_properties
(
example PROPERTIES COMPILE_FLAGS
"/MP /bigobj "
)
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
()
# /MP enables multithreaded builds (relevant when there are many files), /bigobj is
# needed for bigger binding projects due to the limit to 64k addressable sections
set_property
(
TARGET example APPEND PROPERTY COMPILE_OPTIONS /MP /bigobj
)
# Enforce size-based optimization and link time code generation on MSVC
# (~30% smaller binaries in experiments); do nothing in debug mode.
set_property
(
TARGET example APPEND PROPERTY COMPILE_OPTIONS
"$<$<CONFIG:Release>:/Os>"
"$<$<CONFIG:Release>:/GL>"
"$<$<CONFIG:MinSizeRel>:/Os>"
"$<$<CONFIG:MinSizeRel>:/GL>"
"$<$<CONFIG:RelWithDebInfo>:/Os>"
"$<$<CONFIG:RelWithDebInfo>:/GL>"
)
set_property
(
TARGET example APPEND_STRING PROPERTY LINK_FLAGS_RELEASE
"/LTCG "
)
set_property
(
TARGET example APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL
"/LTCG "
)
set_property
(
TARGET example APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO
"/LTCG "
)
endif
()
# .PYD file extension on Windows
...
...
docs/cmake.rst
View file @
bdd11030
...
...
@@ -106,17 +106,19 @@ subdirectory named :file:`pybind11`.
if (WIN32)
if (MSVC)
# /bigobj is needed for bigger binding projects due to the limit to 64k
# addressable sections. /MP enables multithreaded builds (relevant when
# there are many files).
set_target_properties(example PROPERTIES COMPILE_FLAGS "/MP /bigobj ")
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()
# /MP enables multithreaded builds (relevant when there are many files), /bigobj is
# needed for bigger binding projects due to the limit to 64k addressable sections
set_property(TARGET example APPEND PROPERTY COMPILE_OPTIONS /MP /bigobj)
# Enforce size-based optimization and link time code generation on MSVC
# (~30% smaller binaries in experiments); do nothing in debug mode.
set_property(TARGET example APPEND PROPERTY COMPILE_OPTIONS
"$<$<CONFIG:Release>:/Os>" "$<$<CONFIG:Release>:/GL>"
"$<$<CONFIG:MinSizeRel>:/Os>" "$<$<CONFIG:MinSizeRel>:/GL>"
"$<$<CONFIG:RelWithDebInfo>:/Os>" "$<$<CONFIG:RelWithDebInfo>:/GL>"
)
set_property(TARGET example APPEND_STRING PROPERTY LINK_FLAGS_RELEASE "/LTCG ")
set_property(TARGET example APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL "/LTCG ")
set_property(TARGET example APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO "/LTCG ")
endif()
# .PYD file extension on Windows
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment