## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0


SET(ZE_LOADER_RUNTIME_LINK_NAME_LINUX "libze_loader.so.1" CACHE STRING "Name of the ze_loader lib that is looked for at runtime on Linux")
SET(ZE_LOADER_RUNTIME_LINK_NAME_WINDOWS "ze_loader.dll" CACHE STRING "Name of the ze_loader lib that is looked for at runtime on Windows")

MARK_AS_ADVANCED(ZE_LOADER_RUNTIME_LINK_NAME_LINUX)
MARK_AS_ADVANCED(ZE_LOADER_RUNTIME_LINK_NAME_WINDOWS)

ADD_LIBRARY(ze_wrapper STATIC ze_wrapper.cpp)
IF (NOT ZE_RAYTRACING_SYCL_TESTS STREQUAL "LEVEL_ZERO_RTAS_BUILDER")
  TARGET_LINK_LIBRARIES(ze_wrapper PUBLIC embree_rthwif)
ELSE()
  ADD_COMPILE_DEFINITIONS(ZE_RAYTRACING_DISABLE_INTERNAL_BUILDER)
ENDIF()

TARGET_INCLUDE_DIRECTORIES(ze_wrapper PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_COMPILE_DEFINITIONS(ze_wrapper PRIVATE ZE_LOADER_NAME_LINUX="${ZE_LOADER_RUNTIME_LINK_NAME_LINUX}")
TARGET_COMPILE_DEFINITIONS(ze_wrapper PRIVATE ZE_LOADER_NAME_WINDOWS="${ZE_LOADER_RUNTIME_LINK_NAME_WINDOWS}")

