diff options
author | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-05-12 14:40:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-16 14:46:35 (GMT) |
commit | 993dde925f208d98c68edcd451b0d6979e0abdd4 (patch) | |
tree | d6d039fd0952b192ca8ffb4d0d01bae3bab78e5d /Source/cmGlobalNinjaGenerator.cxx | |
parent | 023af4ab2f8d45d0ed5ca6acdf3018cd4cee4624 (diff) | |
download | CMake-993dde925f208d98c68edcd451b0d6979e0abdd4.zip CMake-993dde925f208d98c68edcd451b0d6979e0abdd4.tar.gz CMake-993dde925f208d98c68edcd451b0d6979e0abdd4.tar.bz2 |
TargetGenerator: Factor out generation of code check rules
De-duplicate code check rule generation in Ninja and Makefile generators
by moving their implementation to `cmCommonTargetGenerator`.
Previously Ninja was generating code check rules per language.
It was changed to generate code check rules for each source file.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 7626fa3..b598c9b 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -507,8 +507,18 @@ void cmGlobalNinjaGenerator::WriteVariable(std::ostream& os, return; } + std::string val; + static std::unordered_set<std::string> const variablesShouldNotBeTrimmed = { + "CODE_CHECK", "LAUNCHER" + }; + if (variablesShouldNotBeTrimmed.find(name) == + variablesShouldNotBeTrimmed.end()) { + val = cmTrimWhitespace(value); + } else { + val = value; + } + // Do not add a variable if the value is empty. - std::string val = cmTrimWhitespace(value); if (val.empty()) { return; } |