Skip to content

Commit 0433e4d

Browse files
[SYCL-RTC] Fix MacOS post-commit build failure (intel#19982)
Failed after intel#19924. `remangled-*` requiring `libspirv-builtins` on top of `libclc` is technically a separate issue but I realized it while working on fixing the CI, so can go in in the same PR.
1 parent 7e292b9 commit 0433e4d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

sycl-jit/jit-compiler/CMakeLists.txt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ else()
99
set(SYCL_JIT_VIRTUAL_TOOLCHAIN_ROOT "/sycl-jit-toolchain/")
1010
endif()
1111

12+
# TODO: libdevice
13+
set(SYCL_JIT_RESOURCE_DEPS sycl-headers clang ${CMAKE_CURRENT_SOURCE_DIR}/utils/generate.py)
14+
15+
if ("libclc" IN_LIST LLVM_ENABLE_PROJECTS)
16+
# Somehow just "libclc" doesn't build "remangled-*" (and maybe whatever else).
17+
list(APPEND SYCL_JIT_RESOURCE_DEPS libclc libspirv-builtins)
18+
endif()
19+
1220
add_custom_command(
1321
OUTPUT ${SYCL_JIT_RESOURCE_CPP}
1422
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/generate.py --toolchain-dir ${CMAKE_BINARY_DIR} --output ${SYCL_JIT_RESOURCE_CPP} --prefix ${SYCL_JIT_VIRTUAL_TOOLCHAIN_ROOT}
1523
DEPENDS
16-
sycl-headers # include/sycl
17-
libclc # lib/clc
18-
clang # lib/clang
19-
# TODO: libdevice
20-
${CMAKE_CURRENT_SOURCE_DIR}/utils/generate.py
24+
${SYCL_JIT_RESOURCE_DEPS}
2125
)
2226

2327
# We use C23/C++26's `#embed` to implement this resource creation, and "current"
@@ -34,6 +38,13 @@ if (WIN32)
3438
else()
3539
get_host_tool_path( clang CLANG clang_exe clang_target )
3640
set(SYCL_JIT_RESOURCE_CXX_FLAGS -O2 -Wno-c23-extensions -std=c++17 -fPIC -fvisibility=hidden)
41+
42+
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
43+
# Hack based on the information at
44+
# https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_SYSROOT.html
45+
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE SYCL_JIT_OSX_SYSROOT)
46+
list(APPEND SYCL_JIT_RESOURCE_CXX_FLAGS -isysroot ${SYCL_JIT_OSX_SYSROOT})
47+
endif()
3748
endif()
3849

3950
add_custom_command(

0 commit comments

Comments
 (0)