@@ -24,10 +24,6 @@ project(_dpexrt_python
24
24
DESCRIPTION "A Python C extension for numba-dpex runtime."
25
25
)
26
26
27
- # Help conda build find path from both host and build env.
28
- set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )
29
- set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH )
30
-
31
27
# Get numba include path
32
28
if (NOT DEFINED Numba_INCLUDE_DIRS )
33
29
execute_process (
@@ -78,23 +74,12 @@ endif()
78
74
set (SKBUILD_MODULE_PATH ${SKBUILD_PATH} /resources/cmake )
79
75
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SKBUILD_MODULE_PATH} )
80
76
81
- # Check CMAKE_MODULE_PATH
82
- message (STATUS "CMAKE_MODULE_PATH=" "${CMAKE_MODULE_PATH} " )
83
-
84
77
# Add packages
85
78
find_package (Python 3.9 REQUIRED
86
79
COMPONENTS Interpreter Development.Module NumPy )
87
80
find_package (Dpctl REQUIRED )
88
81
find_package (IntelSYCL REQUIRED )
89
82
90
- # Includes
91
- include (GNUInstallDirs )
92
- include_directories (${Python_INCLUDE_DIRS} )
93
- include_directories (${Python_NumPy_INCLUDE_DIRS} )
94
- include_directories (${Numba_INCLUDE_DIRS} )
95
- include_directories (${Dpctl_INCLUDE_DIRS} )
96
- include_directories (. )
97
-
98
83
# Source files, *.c
99
84
file (GLOB_RECURSE DPEXRT_SOURCES CONFIGURE_DEPENDS "*.c" )
100
85
file (GLOB_RECURSE KERNEL_SOURCES CONFIGURE_DEPENDS "*.cpp" )
@@ -109,7 +94,20 @@ python_add_library(${PROJECT_NAME} MODULE ${SOURCES})
109
94
# Add SYCL to target, this must come after python_add_library()
110
95
add_sycl_to_target (TARGET ${PROJECT_NAME} SOURCES ${KERNEL_SOURCES} )
111
96
112
- # Link the DPCTLSyclInterface library to target
97
+ # Add source headers
98
+ target_include_directories (${PROJECT_NAME} PRIVATE . )
99
+
100
+ # Add Numba Runtime headers
101
+ target_include_directories (${PROJECT_NAME} PRIVATE ${Numba_INCLUDE_DIRS} )
102
+
103
+ # Link numpy
104
+ target_link_libraries (${PROJECT_NAME} PRIVATE Python::NumPy )
105
+
106
+ # TODO: switch to CMake, once dpctl supports it.
107
+ # Include DPCTL libraray
108
+ target_include_directories (${PROJECT_NAME} PRIVATE ${Dpctl_INCLUDE_DIRS} )
109
+ # Linking target binary with DPCTLSyclInterface.so/.dll so the symbols could
110
+ # be found during runtime.
113
111
target_link_libraries (${PROJECT_NAME} PRIVATE DPCTLSyclInterface )
114
112
115
113
# Install
0 commit comments