diff --git a/CMakeLists.txt b/CMakeLists.txt index bffd19905b..44fd0cd8bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,10 +18,6 @@ This ``CMakeLists.txt`` file will be used by ``setup.py``. cmake_minimum_required(VERSION 3.21...3.27 FATAL_ERROR) -if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24") - cmake_policy(SET CMP0135 NEW) -endif() - message(STATUS "NUMBA_DPEX_VERSION=" "${NUMBA_DPEX_VERSION}") project(numba-dpex diff --git a/numba_dpex/core/runtime/CMakeLists.txt b/numba_dpex/core/runtime/CMakeLists.txt index 23d00098d5..674cc03db6 100644 --- a/numba_dpex/core/runtime/CMakeLists.txt +++ b/numba_dpex/core/runtime/CMakeLists.txt @@ -78,10 +78,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SKBUILD_MODULE_PATH}) message(STATUS "CMAKE_MODULE_PATH=" "${CMAKE_MODULE_PATH}") # Add packages -find_package(PythonLibs REQUIRED) -find_package(PythonExtensions REQUIRED) -find_package(NumPy REQUIRED) +find_package(Python 3.9 REQUIRED + COMPONENTS Interpreter Development.Module NumPy) find_package(Dpctl REQUIRED) +find_package(NumPy REQUIRED) # Includes include(GNUInstallDirs) @@ -98,14 +98,10 @@ file(GLOB SOURCES "*.c") link_directories(${DPCTL_LIBRARY_PATH}) # Output static library, *.so or *.dll -add_library(${PROJECT_NAME} MODULE ${SOURCES}) - -# Link the static library to python libraries and DPCTLSyclInterface -target_link_libraries(${PROJECT_NAME} ${Python_LIBRARIES}) -target_link_libraries(${PROJECT_NAME} DPCTLSyclInterface) +python_add_library(${PROJECT_NAME} MODULE ${SOURCES}) -# Build python extension module -python_extension_module(${PROJECT_NAME}) +# Link the DPCTLSyclInterface library to target +target_link_libraries(${PROJECT_NAME} PRIVATE DPCTLSyclInterface) # If IS_DEVELOP, copy back the target into numba_dpex/core/runtime if(IS_DEVELOP)