Skip to content

Commit a86ad73

Browse files
authored
[offload] Add missing build dependency (#149326)
libc++ headers must be generated before compiling part of liboffload. The build error occurs if clang is configured to use libc++ by default. Fixes issue #149324
1 parent 27f777e commit a86ad73

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

offload/tools/offload-tblgen/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,11 @@ add_tablegen(offload-tblgen OFFLOAD
2222
RecordTypes.hpp
2323
)
2424

25+
# Make sure that C++ headers are available, if libcxx is built at the same
26+
# time. This is important if clang is set to prefer libc++ over libstdc++
27+
if(TARGET cxx-headers)
28+
add_dependencies(offload-tblgen cxx-headers)
29+
endif()
30+
2531
set(OFFLOAD_TABLEGEN_EXE "${OFFLOAD_TABLEGEN_EXE}" CACHE INTERNAL "")
2632
set(OFFLOAD_TABLEGEN_TARGET "${OFFLOAD_TABLEGEN_TARGET}" CACHE INTERNAL "")

0 commit comments

Comments
 (0)