-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Ultimaker/fix-python-binding-build
Remove redundant fPIC check and improve pybind11 config
- Loading branch information
Showing
2 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
find_package(pybind11 REQUIRED) | ||
set(ENV{LD_LIBRARY_PATH} "${CMAKE_LIBRARY_PATH}:${LD_LIBRARY_PATH}") # Needed to ensure that CMake finds the Conan CPython library | ||
find_package(Python COMPONENTS Interpreter Development) | ||
find_package(pybind11 REQUIRED) | ||
|
||
pybind11_add_module(pyDulcificum pyDulcificum.cpp) | ||
target_link_libraries(pyDulcificum PUBLIC dulcificum pybind11::pybind11) | ||
target_compile_definitions(pyDulcificum PRIVATE PYDULCIFICUM_VERSION="${PYDULCIFICUM_VERSION}") | ||
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) | ||
pybind11_strip(pyDulcificum) | ||
endif() | ||
pybind11_add_module(pyDulcificum pyDulcificum.cpp) | ||
target_link_libraries(pyDulcificum PUBLIC dulcificum pybind11::pybind11) | ||
target_compile_definitions(pyDulcificum PRIVATE PYDULCIFICUM_VERSION="${PYDULCIFICUM_VERSION}") | ||
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) | ||
pybind11_strip(pyDulcificum) | ||
endif() |