mirror-llvm-project/libsycl/tools/sycl-ls/CMakeLists.txt
Sergey Semenov 5cd21e8498
[libsycl][Driver] Move and rename the SYCL shared library (#188770)
Align the shared library with other runtime libraries:

- Rename from libsycl.so to libLLVMSYCL.so
- Make install dir include the host triple if
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is ON.

Also updates the Clang driver to be aligned with the new location by
relanding https://github.com/llvm/llvm-project/pull/189053

---------

Co-authored-by: Srividya Sundaram <srividya.sundaram@intel.com>
2026-04-20 11:54:02 -07:00

29 lines
1,001 B
CMake

add_executable(sycl-ls sycl-ls.cpp)
target_include_directories(sycl-ls SYSTEM PRIVATE ${LLVM_MAIN_INCLUDE_DIR})
target_link_libraries(sycl-ls PRIVATE LLVMSupport LLVMObject)
add_dependencies(sycl-ls ${LIBSYCL_LIB_NAME})
target_include_directories(sycl-ls PRIVATE ${LIBSYCL_BUILD_INCLUDE_DIR})
target_link_libraries(sycl-ls
PRIVATE
${LIBSYCL_SHARED_OUTPUT_NAME}
)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fno-rtti COMPILER_HAS_NORTTI_FLAG)
if (NOT LLVM_ENABLE_RTTI AND COMPILER_HAS_NORTTI_FLAG)
target_compile_options(sycl-ls PRIVATE -fno-rtti)
endif()
if (WIN32)
# For security purposes, searches for dependent libraries are limited to
# the combination of directories specified by the following flags of
# LoadLibraryEx().
# - LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR (0x100)
# - LOAD_LIBRARY_SEARCH_SYSTEM32 (0x800)
target_link_options(sycl-ls PRIVATE LINKER:/DEPENDENTLOADFLAG:0x900)
endif()
install(TARGETS sycl-ls
RUNTIME DESTINATION "bin" COMPONENT sycl-ls)