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:
ClausKlein authored and Brad King committed 2024-04-08 19:10:10 -04:00
1 parent 01829f4715
commit b0773aa4f6
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -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)