Skip to content

Commit 44ea638

Browse files
Fix cmake script (#1725)
* find NumPy package via cmake's Python integration * Use interface library to include NumPy's include dirs No library is linked, but interface library provides include dir path. --------- Co-authored-by: Anton <[email protected]>
1 parent 95fdbec commit 44ea638

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ FetchContent_Declare(
6363
)
6464
FetchContent_MakeAvailable(pybind11)
6565

66-
find_package(Python REQUIRED COMPONENTS Development.Module)
67-
find_package(NumPy REQUIRED)
66+
find_package(Python REQUIRED COMPONENTS Development.Module NumPy)
6867

6968
set(CYTHON_FLAGS "-t -w \"${CMAKE_SOURCE_DIR}\"")
7069
find_package(Cython REQUIRED)

dpnp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function(build_dpnp_cython_ext _trgt _src _dest)
2121

2222
# NumPy
2323
target_compile_definitions(${_trgt} PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
24-
target_include_directories(${_trgt} PRIVATE ${NumPy_INCLUDE_DIR})
24+
target_link_libraries(${_trgt} PRIVATE Python::NumPy)
2525

2626
# Dpctl
2727
target_include_directories(${_trgt} PRIVATE ${Dpctl_INCLUDE_DIR})

0 commit comments

Comments
 (0)