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
a59c6de8
Commit
a59c6de8
authored
Jul 22, 2020
by
Henry Schreiner
Committed by
Henry Schreiner
Jul 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: allow MSVC/Xcode to run the embed test
parent
49007b7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
tests/CMakeLists.txt
+2
-2
tests/test_embed/CMakeLists.txt
+10
-6
No files found.
tests/CMakeLists.txt
View file @
a59c6de8
...
@@ -211,10 +211,10 @@ foreach(target ${test_targets})
...
@@ -211,10 +211,10 @@ foreach(target ${test_targets})
# Always write the output file directly into the 'tests' directory (even on MSVC)
# Always write the output file directly into the 'tests' directory (even on MSVC)
if
(
NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY
)
if
(
NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY
)
set_target_properties
(
${
target
}
PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${
testdir
}
)
set_target_properties
(
${
target
}
PROPERTIES LIBRARY_OUTPUT_DIRECTORY
"
${
testdir
}
"
)
foreach
(
config
${
CMAKE_CONFIGURATION_TYPES
}
)
foreach
(
config
${
CMAKE_CONFIGURATION_TYPES
}
)
string
(
TOUPPER
${
config
}
config
)
string
(
TOUPPER
${
config
}
config
)
set_target_properties
(
${
target
}
PROPERTIES LIBRARY_OUTPUT_DIRECTORY_
${
config
}
${
testdir
}
)
set_target_properties
(
${
target
}
PROPERTIES LIBRARY_OUTPUT_DIRECTORY_
${
config
}
"
${
testdir
}
"
)
endforeach
()
endforeach
()
endif
()
endif
()
endforeach
()
endforeach
()
...
...
tests/test_embed/CMakeLists.txt
View file @
a59c6de8
...
@@ -17,25 +17,29 @@ add_executable(test_embed
...
@@ -17,25 +17,29 @@ add_executable(test_embed
catch.cpp
catch.cpp
test_interpreter.cpp
test_interpreter.cpp
)
)
target_include_directories
(
test_embed PRIVATE
${
CATCH_INCLUDE_DIR
}
)
target_include_directories
(
test_embed PRIVATE
"
${
CATCH_INCLUDE_DIR
}
"
)
pybind11_enable_warnings
(
test_embed
)
pybind11_enable_warnings
(
test_embed
)
if
(
NOT CMAKE_VERSION VERSION_LESS 3.0
)
if
(
NOT CMAKE_VERSION VERSION_LESS 3.0
)
target_link_libraries
(
test_embed PRIVATE pybind11::embed
)
target_link_libraries
(
test_embed PRIVATE pybind11::embed
)
else
()
else
()
target_include_directories
(
test_embed PRIVATE
${
PYBIND11_INCLUDE_DIR
}
${
PYTHON_INCLUDE_DIRS
}
)
target_include_directories
(
test_embed PRIVATE
"
${
PYBIND11_INCLUDE_DIR
}
"
"
${
PYTHON_INCLUDE_DIRS
}
"
)
target_compile_options
(
test_embed PRIVATE
${
PYBIND11_CPP_STANDARD
}
)
target_compile_options
(
test_embed PRIVATE
"
${
PYBIND11_CPP_STANDARD
}
"
)
target_link_libraries
(
test_embed PRIVATE
${
PYTHON_LIBRARIES
}
)
target_link_libraries
(
test_embed PRIVATE
"
${
PYTHON_LIBRARIES
}
"
)
endif
()
endif
()
find_package
(
Threads REQUIRED
)
find_package
(
Threads REQUIRED
)
target_link_libraries
(
test_embed PUBLIC
${
CMAKE_THREAD_LIBS_INIT
}
)
target_link_libraries
(
test_embed PUBLIC
${
CMAKE_THREAD_LIBS_INIT
}
)
add_custom_target
(
cpptest COMMAND $<TARGET_FILE:test_embed>
add_custom_target
(
cpptest COMMAND $<TARGET_FILE:test_embed>
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
pybind11_add_module
(
external_module THIN_LTO external_module.cpp
)
pybind11_add_module
(
external_module THIN_LTO external_module.cpp
)
set_target_properties
(
external_module PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
set_target_properties
(
external_module PROPERTIES LIBRARY_OUTPUT_DIRECTORY
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
foreach
(
config
${
CMAKE_CONFIGURATION_TYPES
}
)
string
(
TOUPPER
${
config
}
config
)
set_target_properties
(
external_module PROPERTIES LIBRARY_OUTPUT_DIRECTORY_
${
config
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
endforeach
()
add_dependencies
(
cpptest external_module
)
add_dependencies
(
cpptest external_module
)
add_dependencies
(
check cpptest
)
add_dependencies
(
check cpptest
)
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