Skip to content

Commit

Permalink
PYBIND11_FINDPYTHON=ON
Browse files Browse the repository at this point in the history
Reuse our `find_package(Python ...)` call and use new CMake logic in
pybind11.
https://pybind11.readthedocs.io/en/stable/compiling.html#modules-with-cmake

Signed-off-by: Axel Huebl <[email protected]>
  • Loading branch information
ax3l committed Oct 11, 2024
1 parent 623cee4 commit f967cbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmake/dependencies/pybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ function(find_pybind11)
message(STATUS "pybind11 repository: ${ImpactX_pybind11_repo} (${ImpactX_pybind11_branch})")
include(FetchContent)
endif()

# rely on our find_package(Python ...) call
# https://pybind11.readthedocs.io/en/stable/compiling.html#modules-with-cmake
set(PYBIND11_FINDPYTHON ON)

if(ImpactX_pybind11_internal OR ImpactX_pybind11_src)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def build_extension(self, ext):
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=" + os.path.join(extdir, "impactx"),
"-DCMAKE_VERBOSE_MAKEFILE=ON",
"-DCMAKE_PYTHON_OUTPUT_DIRECTORY=" + extdir,
"-DPython_EXECUTABLE=" + sys.executable,
## variants
"-DImpactX_COMPUTE=" + ImpactX_COMPUTE,
"-DImpactX_FFT:BOOL=" + ImpactX_FFT,
Expand Down

0 comments on commit f967cbe

Please sign in to comment.