@@ -6,13 +6,14 @@ def get_target_os():
66 (run_cpu, run_vendor, run_os, run_version) = re.match(' ([^-]+)-([^-]+)-([^0-9]+)(.*)' , config.variant_triple).groups()
77 return run_os
88
9- clang_opt = ' '
9+ clang_compile_opt = ' -I' + config.swiftlib_dir + ' '
10+ clang_opt = clang_compile_opt
1011
1112if get_target_os() in [' windows-msvc' ]:
1213 config.substitutions.insert(0, (' %target-abi' , ' WIN' ))
1314 # Clang should build object files with link settings equivalent to -libc MD
1415 # when building for the MSVC target.
15- clang_opt = ' -D_MT -D_DLL -Xclang --dependent-lib=msvcrt -Xclang --dependent-lib=oldnames '
16+ clang_opt = clang_compile_opt + ' -D_MT -D_DLL -Xclang --dependent-lib=msvcrt -Xclang --dependent-lib=oldnames '
1617else:
1718 # FIXME(compnerd) do all the targets we currently support use SysV ABI?
1819 config.substitutions.insert(0, (' %target-abi' , ' SYSV' ))
@@ -29,13 +30,13 @@ config.substitutions.insert(0, ('%target-interop-build-clangxx', '%target-clangx
2930
3031# Test parsing of the generated C++ header in different C++ language modes.
3132config.substitutions.insert(0, (' %check-interop-cxx-header-in-clang\( ([^)]+)\) ' ,
32- SubstituteCaptures(r' %check-cxx-header-in-clang -std=c++14 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB \1 && '
33- r' %check-cxx-header-in-clang -std=c++17 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB \1 && '
34- r' %check-cxx-header-in-clang -std=c++20 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB \1 ' )))
33+ SubstituteCaptures(r' %check-cxx-header-in-clang -std=c++14 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB ' + clang_compile_opt + r ' \1 && '
34+ r' %check-cxx-header-in-clang -std=c++17 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB ' + clang_compile_opt + r ' \1 && '
35+ r' %check-cxx-header-in-clang -std=c++20 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB ' + clang_compile_opt + r ' \1 ' )))
3536
3637# Test parsing of the generated C++ header in different C++ language modes (with C++20 concepts support).
3738config.substitutions.insert(0, (' %check-generic-interop-cxx-header-in-clang\( ([^)]+)\) ' ,
38- SubstituteCaptures(r' %check-cxx-header-in-clang -std=c++20 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB \1 ' )))
39+ SubstituteCaptures(r' %check-cxx-header-in-clang -std=c++20 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB ' + clang_compile_opt + r ' \1 ' )))
3940
4041# Test parsing of the generated C header in different C language modes.
4142config.substitutions.insert(0, (' %check-interop-c-header-in-clang\( ([^)]+)\) ' ,
0 commit comments