[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 19:00:14 PDT 2025


================
@@ -0,0 +1,128 @@
+#===============================================================================
+# Setup Project
+#===============================================================================
+cmake_minimum_required(VERSION 3.20.0)
+
+set(LLVM_SUBPROJECT_TITLE "libsycl")
+
+set(LIBSYCL_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
+set(LIBSYCL_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
+
+set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
+set(CMAKE_CXX_STANDARD_REQUIRED YES)
+set(CMAKE_CXX_EXTENSIONS OFF)
----------------
tahonermann wrote:

Hmm, the `STANDALONE` consideration doesn't seem to apply consistently to existing projects. But I do find the argument persuasive. I'm ok to resolve this comment without a further change.

I assume a standalone build option is expected to be provided at some later time?

The following is the result of a brief audit of CMake files that set `CMAKE_CXX_STANDARD`. I suspect some of these cases are indicative of a minor bug. Feel free to ignore; I'm just dumping the data since I did the work to dig it up.

These projects cache the `CMAKE_CXX_STANDARD` setting unconditionally.
-  `flang-rt/CMakeLists.txt`
- `mlir/CMakeLists.txt`
- `mlir/examples/standalone/CMakeLists.txt`
- `llvm/CMakeLists.txt`

These projects cache that setting only when their respective `STANDALONE` condition is true:
- `bolt/CMakeLists.txt`
- `clang/CMakeLists.txt`
- `compiler-rt/CMakeLists.txt`
- `lld/CMakeLists.txt`
- `lldb/CMakeLists.txt`
- `offload/CMakeLists.txt`
- `openmp/CMakeLists.txt`

These projects do not cache that setting despite having a `STANDALONE` build mode.
- `bolt/runtime/CMakeLists.txt`
- `flang/CMakeLists.txt`
- `libclc/CMakeLists.txt`

These projects do not cache that setting and do not appear to have a `STANDALONE` build mode.
- `libc/CMakeLists.txt`
- `libcxx/test/tools/clang_tidy_checks/CMakeLists.txt`
- `third-party/benchmark/CMakeLists.txt`

https://github.com/llvm/llvm-project/pull/144372


More information about the llvm-commits mailing list