Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
bdd11030
Commit
bdd11030
authored
May 01, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cmake improvements on windows
parent
6fb48490
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
+24
-20
CMakeLists.txt
+12
-10
docs/cmake.rst
+12
-10
No files found.
CMakeLists.txt
View file @
bdd11030
...
@@ -148,17 +148,19 @@ endforeach()
...
@@ -148,17 +148,19 @@ endforeach()
if
(
WIN32
)
if
(
WIN32
)
if
(
MSVC
)
if
(
MSVC
)
# /bigobj is needed for bigger binding projects due to the limit to 64k
# /MP enables multithreaded builds (relevant when there are many files), /bigobj is
# addressable sections. /MP enables multithreaded builds (relevant when
# needed for bigger binding projects due to the limit to 64k addressable sections
# there are many files).
set_property
(
TARGET example APPEND PROPERTY COMPILE_OPTIONS /MP /bigobj
)
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
# Enforce size-based optimization and link time code generation on MSVC
# (~30% smaller binaries in experiments).
# (~30% smaller binaries in experiments); do nothing in debug mode.
set_target_properties
(
example APPEND_STRING PROPERTY COMPILE_FLAGS
"/Os /GL "
)
set_property
(
TARGET example APPEND PROPERTY COMPILE_OPTIONS
set_target_properties
(
example APPEND_STRING PROPERTY LINK_FLAGS
"/LTCG "
)
"$<$<CONFIG:Release>:/Os>"
"$<$<CONFIG:Release>:/GL>"
endif
()
"$<$<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
()
endif
()
# .PYD file extension on Windows
# .PYD file extension on Windows
...
...
docs/cmake.rst
View file @
bdd11030
...
@@ -106,17 +106,19 @@ subdirectory named :file:`pybind11`.
...
@@ -106,17 +106,19 @@ subdirectory named :file:`pybind11`.
if (WIN32)
if (WIN32)
if (MSVC)
if (MSVC)
# /bigobj is needed for bigger binding projects due to the limit to 64k
# /MP enables multithreaded builds (relevant when there are many files), /bigobj is
# addressable sections. /MP enables multithreaded builds (relevant when
# needed for bigger binding projects due to the limit to 64k addressable sections
# there are many files).
set_property(TARGET example APPEND PROPERTY COMPILE_OPTIONS /MP /bigobj)
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
# Enforce size-based optimization and link time code generation on MSVC
# (~30% smaller binaries in experiments).
# (~30% smaller binaries in experiments); do nothing in debug mode.
set_target_properties(example APPEND_STRING PROPERTY COMPILE_FLAGS "/Os /GL ")
set_property(TARGET example APPEND PROPERTY COMPILE_OPTIONS
set_target_properties(example APPEND_STRING PROPERTY LINK_FLAGS "/LTCG ")
"$<$<CONFIG:Release>:/Os>" "$<$<CONFIG:Release>:/GL>"
endif()
"$<$<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()
endif()
# .PYD file extension on Windows
# .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