1
0
Эх сурвалжийг харах

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.
ClausKlein 1 жил өмнө
parent
commit
b0773aa4f6

+ 2 - 1
Source/cmGeneratorTarget.cxx

@@ -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;

+ 1 - 1
Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets-check.cmake

@@ -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)