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
518cf721
Commit
518cf721
authored
Jan 21, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve cmake windows debug configuration (fixes #77)
parent
fa92f679
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
CMakeLists.txt
+12
-7
docs/cmake.rst
+11
-6
No files found.
CMakeLists.txt
View file @
518cf721
...
@@ -129,12 +129,17 @@ endforeach()
...
@@ -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
...
@@ -151,7 +156,7 @@ elseif (UNIX)
...
@@ -151,7 +156,7 @@ elseif (UNIX)
# conflicting Python instances are active at the same time (even when they
# conflicting Python instances are active at the same time (even when they
# are of the same version).
# are of the same version).
# Windows is not affected by this issue since it handles DLL imports
# Windows is not affected by this issue since it handles DLL imports
# differently. The solution for Linux and Mac OS is simple: we just don't
# differently. The solution for Linux and Mac OS is simple: we just don't
# link against the Python library. The resulting shared library will have
# link against the Python library. The resulting shared library will have
# missing symbols, but that's perfectly fine -- they will be resolved at
# missing symbols, but that's perfectly fine -- they will be resolved at
...
...
docs/cmake.rst
View file @
518cf721
...
@@ -84,12 +84,17 @@ and that the pybind11 repository is located in a subdirectory named :file:`pybin
...
@@ -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
...
...
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