mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 03:29:18 -05:00
VERIFY_INTERFACE_HEADER_SETS: Suppress clang-tidy include checks
`clang-tidy-17` adds include checks similar to IWYU. Suppress them in generated code.
This commit is contained in:
@@ -9194,8 +9194,10 @@ std::string cmGeneratorTarget::GenerateHeaderSetVerificationFile(
|
|||||||
// consider the headerFile as part of the entire language
|
// consider the headerFile as part of the entire language
|
||||||
// unit within include-what-you-use and as a result allows
|
// unit within include-what-you-use and as a result allows
|
||||||
// one to get IWYU advice for headers.
|
// one to get IWYU advice for headers.
|
||||||
fout << "#include <" << headerFilename
|
// Also suppress clang-tidy include checks in generated code.
|
||||||
<< "> /* IWYU pragma: associated */\n";
|
fout
|
||||||
|
<< "/* NOLINTNEXTLINE(misc-header-include-cycle,misc-include-cleaner) */\n"
|
||||||
|
<< "#include <" << headerFilename << "> /* IWYU pragma: associated */\n";
|
||||||
fout.close();
|
fout.close();
|
||||||
|
|
||||||
return filename;
|
return filename;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function(check_file target filename)
|
|||||||
if(filename MATCHES "^(.*)(\\.[a-z]+)$")
|
if(filename MATCHES "^(.*)(\\.[a-z]+)$")
|
||||||
set(header_filename "${CMAKE_MATCH_1}")
|
set(header_filename "${CMAKE_MATCH_1}")
|
||||||
endif()
|
endif()
|
||||||
set(expected_contents "#include <${header_filename}> /* IWYU pragma: associated */\n")
|
set(expected_contents "/* NOLINTNEXTLINE(misc-header-include-cycle,misc-include-cleaner) */\n#include <${header_filename}> /* IWYU pragma: associated */\n")
|
||||||
file(READ "${full_filename}" actual_contents)
|
file(READ "${full_filename}" actual_contents)
|
||||||
|
|
||||||
if(NOT actual_contents STREQUAL expected_contents)
|
if(NOT actual_contents STREQUAL expected_contents)
|
||||||
|
|||||||
Reference in New Issue
Block a user