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
9343e68b
Commit
9343e68b
authored
Sep 14, 2018
by
Davis E. King
Committed by
Wenzel Jakob
Sep 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cmake scripts so projects using CUDA .cu files build correctly. (#1441)
parent
c8e9f3cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
tools/pybind11Tools.cmake
+11
-1
No files found.
tools/pybind11Tools.cmake
View file @
9343e68b
...
...
@@ -156,6 +156,7 @@ function(pybind11_add_module target_name)
# namespace; also turning it on for a pybind module compilation here avoids
# potential warnings or issues from having mixed hidden/non-hidden types.
set_target_properties
(
${
target_name
}
PROPERTIES CXX_VISIBILITY_PRESET
"hidden"
)
set_target_properties
(
${
target_name
}
PROPERTIES CUDA_VISIBILITY_PRESET
"hidden"
)
if
(
WIN32 OR CYGWIN
)
# Link against the Python shared library on Windows
...
...
@@ -208,6 +209,15 @@ function(pybind11_add_module target_name)
if
(
MSVC
)
# /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
target_compile_options
(
${
target_name
}
PRIVATE /MP /bigobj
)
set
(
msvc_extra_options /MP /bigobj
)
if
(
CMAKE_VERSION VERSION_LESS 3.11
)
target_compile_options
(
${
target_name
}
PRIVATE
${
msvc_extra_options
}
)
else
()
# Only set these options for C++ files. This is important so that, for
# instance, projects that include other types of source files like CUDA
# .cu files don't get these options propagated to nvcc since that would
# cause the build to fail.
target_compile_options
(
${
target_name
}
PRIVATE $<$<COMPILE_LANGUAGE:CXX>:
${
msvc_extra_options
}
>
)
endif
()
endif
()
endfunction
()
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