mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
VERIFY_INTERFACE_HEADER_SETS: Add IWYU pragma as C-style comment
In commit 6942234bf5 (VERIFY_INTERFACE_HEADER_SETS: Add IWYU pragma:
associated to verification file, 2022-10-07, v3.25.0-rc1~22^2) the
comment was added as a C++-style comment. The feature works in C too,
so use a C-style comment.
This commit is contained in:
@@ -9194,7 +9194,8 @@ std::string cmGeneratorTarget::GenerateHeaderSetVerificationFile(
|
||||
// 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 << "#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}> // IWYU pragma: associated\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