Skip to content

[test] Fix checking C and C++ headers for cross-compilation by explicitly adding the sysroot and target triple #81312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2742,6 +2742,8 @@ extraCheckWarningFlags = (
# Verifies that a C++ file can be compiled without warnings except for some exceptions.
config.substitutions.insert(0, ('%check-c-header-in-clang',
'%clang -fsyntax-only -x c-header ' + extraCheckWarningFlags +
' --sysroot %r ' % config.variant_sdk +
'-target %r ' % config.variant_triple +
# Use standard header/framework search paths.
'-F %%clang-importer-sdk-path/frameworks '
'-I %%clang-include-dir '
Expand All @@ -2751,6 +2753,7 @@ config.substitutions.insert(0, ('%check-c-header-in-clang',
config.substitutions.insert(0, ('%check-cxx-header-in-clang',
'%clangxx -fsyntax-only -x c++-header ' + extraCheckWarningFlags +
' --sysroot %r ' % config.variant_sdk +
'-target %r ' % config.variant_triple +
# Use standard header/framework search paths.
'-F %%clang-importer-sdk-path/frameworks '
'-I %%clang-include-dir %%cxx-stdlib-include '
Expand Down