mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-02 04:02:23 +03:00
VERIFY_INTERFACE_HEADER_SETS: Add IWYU pragma: associated to verification file
This commit is contained in:
1 parent
269652a814
commit
6942234bf5
2 files changed
+6
-2
No files matched your search
@@ -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