## Copyright 2023 Intel Corporation
## SPDX-License-Identifier: BSD-3-Clause

set(TARGET ${PROJECT_NAME}_device_gpu)

message(STATUS "${TARGET} LEVEL_ZERO_INCLUDE_DIR is ${LEVEL_ZERO_INCLUDE_DIR}")
message(STATUS "${TARGET} LEVEL_ZERO_LIB_LOADER is ${LEVEL_ZERO_LIB_LOADER}")

add_library(${TARGET} SHARED GPUDevice.cpp)

target_include_directories(${TARGET} PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../../>
    $<BUILD_INTERFACE:${LEVEL_ZERO_INCLUDE_DIR}>
    )
target_link_libraries(${TARGET} PRIVATE ${LEVEL_ZERO_LIB_LOADER})
target_link_libraries(${TARGET} PRIVATE ispcrt_interface_lib)

set_target_properties(${TARGET} PROPERTIES
    VERSION ${PROJECT_VERSION}
    SOVERSION ${PROJECT_VERSION_MAJOR}
    )

install(TARGETS ${TARGET}
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
