mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 23:30:35 -06:00
VERIFY_INTERFACE_HEADER_SETS: Add IWYU pragma: associated to verification file
This commit is contained in:
@@ -8760,7 +8760,11 @@ std::string cmGeneratorTarget::GenerateHeaderSetVerificationFile(
|
||||
|
||||
cmGeneratedFileStream fout(filename);
|
||||
fout.SetCopyIfDifferent(true);
|
||||
fout << "#include <" << headerFilename << ">\n";
|
||||
// IWYU pragma: associated allows include what you use to
|
||||
// consider the headerFile as part of the entire language
|
||||
// unit within include-what-you-use and as a result allows
|
||||
// one to get IWYU advice for headers :)
|
||||
fout << "#include <" << headerFilename << "> // IWYU pragma: associated\n";
|
||||
fout.close();
|
||||
|
||||
return filename;
|
||||
|
||||
@@ -9,7 +9,7 @@ function(check_file target filename)
|
||||
if(filename MATCHES "^(.*)(\\.[a-z]+)$")
|
||||
set(header_filename "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
set(expected_contents "#include <${header_filename}>\n")
|
||||
set(expected_contents "#include <${header_filename}> // IWYU pragma: associated\n")
|
||||
file(READ "${full_filename}" actual_contents)
|
||||
|
||||
if(NOT actual_contents STREQUAL expected_contents)
|
||||
|
||||
Reference in New Issue
Block a user