-
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.
Remove redundant fPIC check and improve pybind11 config
This commit removes the redundant fPIC option check for shared builds in the `conanfile.py`. Additionally, it improves the `CMakeLists.txt` for `pyDulcificum` to correctly find the Python components required for building and linking the module, ensuring compatibility and correct linking with the Conan CPython library.
- Loading branch information
1 parent
0e5f34e
commit eed800a
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() |