@@ -24,6 +24,10 @@ project(_dpexrt_python
2424 DESCRIPTION "A Python C extension for numba-dpex runtime."
2525)
2626
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+
2731# Get numba include path
2832if (NOT DEFINED Numba_INCLUDE_DIRS)
2933 execute_process (
@@ -79,9 +83,10 @@ message(STATUS "CMAKE_MODULE_PATH=" "${CMAKE_MODULE_PATH}")
7983
8084# Add packages
8185find_package (Python 3.9 REQUIRED
82- COMPONENTS Interpreter Development.Module NumPy )
86+ COMPONENTS Interpreter Development.Module )
8387find_package (Dpctl REQUIRED )
8488find_package (NumPy REQUIRED )
89+ find_package (IntelSYCL REQUIRED )
8590
8691# Includes
8792include (GNUInstallDirs )
@@ -92,14 +97,20 @@ include_directories(${Dpctl_INCLUDE_DIRS})
9297include_directories (. )
9398
9499# Source files, *.c
95- file (GLOB SOURCES "*.c" )
100+ file (GLOB_RECURSE DPEXRT_SOURCES CONFIGURE_DEPENDS "*.c" )
101+ file (GLOB_RECURSE KERNEL_SOURCES CONFIGURE_DEPENDS "*.cpp" )
102+ set (SOURCES ${DPEXRT_SOURCES} ${KERNEL_SOURCES} )
96103
97104# Link dpctl library path with -L
98105link_directories (${DPCTL_LIBRARY_PATH} )
99106
100107# Output static library, *.so or *.dll
101108python_add_library (${PROJECT_NAME} MODULE ${SOURCES} )
102109
110+ # Add SYCL to target, this must come after python_add_library()
111+ # FIXME: sources incompatible with sycl include?
112+ # add_sycl_to_target(TARGET ${PROJECT_NAME} SOURCES ${KERNEL_SOURCES})
113+
103114# Link the DPCTLSyclInterface library to target
104115target_link_libraries (${PROJECT_NAME} PRIVATE DPCTLSyclInterface )
105116
0 commit comments