diff --git a/source/adapters/level_zero/CMakeLists.txt b/source/adapters/level_zero/CMakeLists.txt index d26d0aeb26..84fab50ab4 100644 --- a/source/adapters/level_zero/CMakeLists.txt +++ b/source/adapters/level_zero/CMakeLists.txt @@ -9,14 +9,21 @@ set(TARGET_NAME ur_adapter_level_zero) # Copy L0 loader/headers locally to the build to avoid leaking their path. set(LEVEL_ZERO_COPY_DIR ${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader) if (DEFINED L0_LIBRARY) - get_filename_component(LEVEL_ZERO_LIB_NAME "${L0_LIBRARY}" NAME) - set(LEVEL_ZERO_LIBRARY ${LEVEL_ZERO_COPY_DIR}/${LEVEL_ZERO_LIB_NAME}) - message(STATUS "Copying Level Zero loader and headers to local build tree") - file(COPY ${L0_LIBRARY} DESTINATION ${LEVEL_ZERO_COPY_DIR} FOLLOW_SYMLINK_CHAIN) + get_filename_component(LEVEL_ZERO_LIB_NAME "${L0_LIBRARY}" NAME) + set(LEVEL_ZERO_LIBRARY ${LEVEL_ZERO_COPY_DIR}/${LEVEL_ZERO_LIB_NAME}) + message(STATUS "Copying Level Zero loader and headers to local build tree") + file(COPY ${L0_LIBRARY} DESTINATION ${LEVEL_ZERO_COPY_DIR} FOLLOW_SYMLINK_CHAIN) endif() if (DEFINED L0_INCLUDE_DIR) - set(LEVEL_ZERO_INCLUDE_DIR ${LEVEL_ZERO_COPY_DIR}/level_zero) - file(COPY ${L0_INCLUDE_DIR}/level_zero DESTINATION ${LEVEL_ZERO_COPY_DIR}) + message(STATUS "L0_INCLUDE_DIR: ${L0_INCLUDE_DIR}") + if(EXISTS "${L0_INCLUDE_DIR}/ze_api.h") + message(STATUS "ze_api.h exists in L0_INCLUDE_DIR") + else() + message(STATUS "ze_api.h does not exist in L0_INCLUDE_DIR") + endif() + + set(LEVEL_ZERO_INCLUDE_DIR ${LEVEL_ZERO_COPY_DIR}) + file(COPY ${L0_INCLUDE_DIR} DESTINATION ${LEVEL_ZERO_COPY_DIR}) endif() if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)