[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
This commit is contained in:
Joachim 2025-07-30 09:44:46 +02:00 committed by GitHub
parent 27f777e9c0
commit a86ad73064
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,5 +22,11 @@ add_tablegen(offload-tblgen OFFLOAD
RecordTypes.hpp
)
# Make sure that C++ headers are available, if libcxx is built at the same
# time. This is important if clang is set to prefer libc++ over libstdc++
if(TARGET cxx-headers)
add_dependencies(offload-tblgen cxx-headers)
endif()
set(OFFLOAD_TABLEGEN_EXE "${OFFLOAD_TABLEGEN_EXE}" CACHE INTERNAL "")
set(OFFLOAD_TABLEGEN_TARGET "${OFFLOAD_TABLEGEN_TARGET}" CACHE INTERNAL "")