Skip to content

Commit

Permalink
Merge pull request #24 from Ultimaker/fix-python-binding-build
Browse files Browse the repository at this point in the history
Remove redundant fPIC check and improve pybind11 config
  • Loading branch information
wawanbreton authored Sep 17, 2024
2 parents 0e5f34e + eed800a commit 25e4c9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 0 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ def config_options(self):
del self.options.with_python_bindings

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
if self.options.get_safe("with_python_bindings", False):
self.options["cpython"].shared = True

Expand Down
16 changes: 9 additions & 7 deletions pyDulcificum/CMakeLists.txt
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()

0 comments on commit 25e4c9a

Please sign in to comment.