summaryrefslogtreecommitdiffstats
path: root/Source/cmCommonTargetGenerator.h
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2023-05-12 14:40:28 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-16 14:46:35 (GMT)
commit993dde925f208d98c68edcd451b0d6979e0abdd4 (patch)
treed6d039fd0952b192ca8ffb4d0d01bae3bab78e5d /Source/cmCommonTargetGenerator.h
parent023af4ab2f8d45d0ed5ca6acdf3018cd4cee4624 (diff)
downloadCMake-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/cmCommonTargetGenerator.h')
-rw-r--r--Source/cmCommonTargetGenerator.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 2d23037..c9886d0 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -4,6 +4,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <functional>
#include <map>
#include <set>
#include <string>
@@ -53,6 +54,9 @@ protected:
virtual void AddIncludeFlags(std::string& flags, std::string const& lang,
const std::string& config) = 0;
+ virtual std::string GetClangTidyReplacementsFilePath(
+ std::string const& directory, cmSourceFile const& source,
+ std::string const& config) const = 0;
void AppendOSXVerFlag(std::string& flags, const std::string& lang,
const char* name, bool so);
@@ -63,7 +67,13 @@ protected:
std::string GetIncludes(std::string const& l, const std::string& config);
std::string GetManifests(const std::string& config);
std::string GetAIXExports(std::string const& config);
+ std::string GenerateCodeCheckRules(
+ cmSourceFile const& source, std::string& compilerLauncher,
+ std::string const& cmakeCmd, std::string const& config,
+ std::function<std::string(std::string const&)> const& pathConverter);
+ std::string GetCompilerLauncher(std::string const& lang,
+ std::string const& config);
std::vector<std::string> GetLinkedTargetDirectories(
const std::string& lang, const std::string& config) const;
std::string ComputeTargetCompilePDB(const std::string& config) const;