Skip to content

Commit 1f9d70f

Browse files
Merge pull request swiftlang#83045 from swiftlang/jepa
unittests: Build runtime unit tests with `-DGTEST_NO_LLVM_SUPPORT`
2 parents 95a96f5 + 2b37e96 commit 1f9d70f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

unittests/runtime/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
140140
target_include_directories(SwiftRuntimeTests BEFORE PRIVATE
141141
${SWIFT_SOURCE_DIR}/stdlib/public)
142142

143+
# `stdlib/include/llvm/Support` headers, a subset of
144+
# `llvm-project/llvm/include/llvm/Support`, are not compatible with the
145+
# latter.
146+
#
147+
# Since we favor stdlib headers here, this makes sure Support headers will not
148+
# be transitively included through gtest, and helps to avoid mixed includes,
149+
# where a Support header existing only in LLVM is picked from LLVM, whereas
150+
# a Support header existing in both of the aforementioned directories is
151+
# picked from our stdlib.
152+
target_compile_definitions(SwiftRuntimeTests PRIVATE
153+
GTEST_NO_LLVM_SUPPORT)
154+
143155
# FIXME: cross-compile for all variants.
144156
target_link_libraries(SwiftRuntimeTests
145157
PRIVATE

0 commit comments

Comments
 (0)