Skip to content

Commit ed215b5

Browse files
committed
Remove depricated FindPythonLibs
1 parent 9c85f0e commit ed215b5

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

numba_dpex/core/runtime/CMakeLists.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SKBUILD_MODULE_PATH})
7878
message(STATUS "CMAKE_MODULE_PATH=" "${CMAKE_MODULE_PATH}")
7979

8080
# Add packages
81-
find_package(PythonLibs REQUIRED)
82-
find_package(PythonExtensions REQUIRED)
83-
find_package(NumPy REQUIRED)
81+
find_package(Python 3.9 REQUIRED
82+
COMPONENTS Interpreter Development.Module NumPy)
8483
find_package(Dpctl REQUIRED)
84+
find_package(NumPy REQUIRED)
8585

8686
# Includes
8787
include(GNUInstallDirs)
@@ -98,14 +98,10 @@ file(GLOB SOURCES "*.c")
9898
link_directories(${DPCTL_LIBRARY_PATH})
9999

100100
# Output static library, *.so or *.dll
101-
add_library(${PROJECT_NAME} MODULE ${SOURCES})
102-
103-
# Link the static library to python libraries and DPCTLSyclInterface
104-
target_link_libraries(${PROJECT_NAME} ${Python_LIBRARIES})
105-
target_link_libraries(${PROJECT_NAME} DPCTLSyclInterface)
101+
python_add_library(${PROJECT_NAME} MODULE ${SOURCES})
106102

107-
# Build python extension module
108-
python_extension_module(${PROJECT_NAME})
103+
# Link the DPCTLSyclInterface library to target
104+
target_link_libraries(${PROJECT_NAME} PRIVATE DPCTLSyclInterface)
109105

110106
# If IS_DEVELOP, copy back the target into numba_dpex/core/runtime
111107
if(IS_DEVELOP)

0 commit comments

Comments
 (0)