[llvm] [SYCL] Add libsycl, a SYCL RT library implementation project (PR #144372)
Tom Honermann via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 29 20:50:24 PDT 2025
================
@@ -0,0 +1,111 @@
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes/cmake/Modules")
+include(WarningFlags)
+
+function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
+ if (NOT LLVM_ENABLE_PIC)
+ message( FATAL_ERROR "Position-Independent Code generation is required for libsycl shared library" )
+ endif()
+ # Add an optional argument so we can get the library name to
+ # link with for Windows Debug version
+ cmake_parse_arguments(ARG "" "IMPLIB_NAME" "COMPILE_OPTIONS;SOURCES" ${ARGN})
+
+ add_library(${LIB_OBJ_NAME} OBJECT ${ARG_SOURCES})
+
+ # Common compilation step setup
+ target_compile_definitions(${LIB_OBJ_NAME} PRIVATE $<$<BOOL:${MSVC}>:_LIBSYCL_BUILD_SYCL_DLL>)
----------------
tahonermann wrote:
The dependency on `MSVC` doesn't seem right here. I think `_LIBSYCL_BUILD_SYCL_DLL` should be defined for any compiler targeting Windows given that the check for this macro in `libsycl/include/sycl/__detail/config.hpp` is target (not compiler) specific.
https://github.com/llvm/llvm-project/pull/144372
More information about the llvm-commits
mailing list