summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy1
-rw-r--r--Source/CPack/IFW/cmCPackIFWCommon.cxx8
-rw-r--r--Source/CPack/IFW/cmCPackIFWCommon.h8
-rw-r--r--Source/CPack/IFW/cmCPackIFWRepository.cxx4
-rw-r--r--Source/CPack/IFW/cmCPackIFWRepository.h4
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx2
-rw-r--r--Source/CTest/cmCTestLaunch.cxx2
-rw-r--r--Source/CTest/cmCTestLaunch.h2
-rw-r--r--Source/CTest/cmCTestLaunchReporter.cxx2
-rw-r--r--Source/CTest/cmCTestLaunchReporter.h2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.h2
-rw-r--r--Source/CTest/cmProcess.cxx4
-rw-r--r--Source/CTest/cmProcess.h4
-rw-r--r--Source/cmComputeLinkInformation.cxx3
-rw-r--r--Source/cmDepends.cxx2
-rw-r--r--Source/cmDepends.h2
-rw-r--r--Source/cmDependsJavaParserHelper.cxx2
-rw-r--r--Source/cmDependsJavaParserHelper.h2
-rw-r--r--Source/cmExprParserHelper.h2
-rw-r--r--Source/cmFileLock.h2
-rw-r--r--Source/cmFileLockUnix.cxx2
-rw-r--r--Source/cmFindPathCommand.cxx4
-rw-r--r--Source/cmFindPathCommand.h2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h4
-rw-r--r--Source/cmInstallCommand.cxx88
-rw-r--r--Source/cmInstallScriptGenerator.cxx5
-rw-r--r--Source/cmInstallScriptGenerator.h2
-rw-r--r--Source/cmListFileCache.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmTimestamp.cxx4
-rw-r--r--Source/cmTimestamp.h4
-rw-r--r--Source/cmWorkerPool.cxx8
-rw-r--r--Source/cmXMLSafe.cxx2
-rw-r--r--Source/cmXMLSafe.h2
-rw-r--r--Tests/CMakeLib/run_compile_commands.cxx2
37 files changed, 108 insertions, 91 deletions
diff --git a/.clang-tidy b/.clang-tidy
index ccb36aefe9..098c71f05d 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -24,7 +24,6 @@ readability-*,\
-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-magic-numbers,\
--readability-make-member-function-const,\
-readability-named-parameter,\
-readability-qualified-auto,\
-readability-redundant-access-specifiers,\
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx
index 20d392d211..87ebbfeb9c 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.cxx
+++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx
@@ -44,7 +44,7 @@ bool cmCPackIFWCommon::IsSetToEmpty(const std::string& op) const
: false;
}
-bool cmCPackIFWCommon::IsVersionLess(const char* version)
+bool cmCPackIFWCommon::IsVersionLess(const char* version) const
{
if (!this->Generator) {
return false;
@@ -54,7 +54,7 @@ bool cmCPackIFWCommon::IsVersionLess(const char* version)
cmSystemTools::OP_LESS, this->Generator->FrameworkVersion.data(), version);
}
-bool cmCPackIFWCommon::IsVersionGreater(const char* version)
+bool cmCPackIFWCommon::IsVersionGreater(const char* version) const
{
if (!this->Generator) {
return false;
@@ -65,7 +65,7 @@ bool cmCPackIFWCommon::IsVersionGreater(const char* version)
version);
}
-bool cmCPackIFWCommon::IsVersionEqual(const char* version)
+bool cmCPackIFWCommon::IsVersionEqual(const char* version) const
{
if (!this->Generator) {
return false;
@@ -118,7 +118,7 @@ void cmCPackIFWCommon::ExpandListArgument(
}
}
-void cmCPackIFWCommon::WriteGeneratedByToStrim(cmXMLWriter& xout)
+void cmCPackIFWCommon::WriteGeneratedByToStrim(cmXMLWriter& xout) const
{
if (!this->Generator) {
return;
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.h b/Source/CPack/IFW/cmCPackIFWCommon.h
index 95ed21370e..42deda4eab 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.h
+++ b/Source/CPack/IFW/cmCPackIFWCommon.h
@@ -34,17 +34,17 @@ public:
/**
* Compare \a version with QtIFW framework version
*/
- bool IsVersionLess(const char* version);
+ bool IsVersionLess(const char* version) const;
/**
* Compare \a version with QtIFW framework version
*/
- bool IsVersionGreater(const char* version);
+ bool IsVersionGreater(const char* version) const;
/**
* Compare \a version with QtIFW framework version
*/
- bool IsVersionEqual(const char* version);
+ bool IsVersionEqual(const char* version) const;
/** Expand the list argument containing the map of the key-value pairs.
* If the number of elements is odd, then the first value is used as the
@@ -64,7 +64,7 @@ public:
cmCPackIFWGenerator* Generator;
protected:
- void WriteGeneratedByToStrim(cmXMLWriter& xout);
+ void WriteGeneratedByToStrim(cmXMLWriter& xout) const;
};
#define cmCPackIFWLogger(logType, msg) \
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx
index 12879075a7..7ec2256860 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.cxx
+++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx
@@ -199,7 +199,7 @@ bool cmCPackIFWRepository::PatchUpdatesXml()
return cmSystemTools::RenameFile(updatesPatchXml, updatesXml);
}
-void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout)
+void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout) const
{
xout.StartElement("Repository");
@@ -225,7 +225,7 @@ void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout)
xout.EndElement();
}
-void cmCPackIFWRepository::WriteRepositoryUpdate(cmXMLWriter& xout)
+void cmCPackIFWRepository::WriteRepositoryUpdate(cmXMLWriter& xout) const
{
xout.StartElement("Repository");
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.h b/Source/CPack/IFW/cmCPackIFWRepository.h
index 21afd8bdb1..015345240f 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.h
+++ b/Source/CPack/IFW/cmCPackIFWRepository.h
@@ -76,8 +76,8 @@ public:
bool PatchUpdatesXml();
- void WriteRepositoryConfig(cmXMLWriter& xout);
- void WriteRepositoryUpdate(cmXMLWriter& xout);
+ void WriteRepositoryConfig(cmXMLWriter& xout) const;
+ void WriteRepositoryUpdate(cmXMLWriter& xout) const;
void WriteRepositoryUpdates(cmXMLWriter& xout);
RepositoriesVector RepositoryUpdate;
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 5fb52bf601..3d7d0312b3 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -107,7 +107,7 @@ public:
this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout);
return this->PipeState;
}
- int GetProcessState() { return this->PipeState; }
+ int GetProcessState() const { return this->PipeState; }
private:
int PipeState;
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index b9ed033559..15c443a4c7 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -265,7 +265,7 @@ void cmCTestLaunch::LoadScrapeRules()
}
void cmCTestLaunch::LoadScrapeRules(
- const char* purpose, std::vector<cmsys::RegularExpression>& regexps)
+ const char* purpose, std::vector<cmsys::RegularExpression>& regexps) const
{
std::string fname =
cmStrCat(this->Reporter.LogDir, "Custom", purpose, ".txt");
diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h
index d18f66d6a9..eabb608156 100644
--- a/Source/CTest/cmCTestLaunch.h
+++ b/Source/CTest/cmCTestLaunch.h
@@ -60,7 +60,7 @@ private:
bool ScrapeRulesLoaded;
void LoadScrapeRules();
void LoadScrapeRules(const char* purpose,
- std::vector<cmsys::RegularExpression>& regexps);
+ std::vector<cmsys::RegularExpression>& regexps) const;
bool ScrapeLog(std::string const& fname);
// Helper class to generate the xml fragment.
diff --git a/Source/CTest/cmCTestLaunchReporter.cxx b/Source/CTest/cmCTestLaunchReporter.cxx
index f89fc9b56f..5334a930ef 100644
--- a/Source/CTest/cmCTestLaunchReporter.cxx
+++ b/Source/CTest/cmCTestLaunchReporter.cxx
@@ -150,7 +150,7 @@ void cmCTestLaunchReporter::WriteXML()
this->WriteXMLLabels(e2);
}
-void cmCTestLaunchReporter::WriteXMLAction(cmXMLElement& e2)
+void cmCTestLaunchReporter::WriteXMLAction(cmXMLElement& e2) const
{
e2.Comment("Meta-information about the build action");
cmXMLElement e3(e2, "Action");
diff --git a/Source/CTest/cmCTestLaunchReporter.h b/Source/CTest/cmCTestLaunchReporter.h
index 675a8787e5..4be0d9beb1 100644
--- a/Source/CTest/cmCTestLaunchReporter.h
+++ b/Source/CTest/cmCTestLaunchReporter.h
@@ -70,7 +70,7 @@ public:
// Methods to generate the xml fragment.
void WriteXML();
- void WriteXMLAction(cmXMLElement&);
+ void WriteXMLAction(cmXMLElement&) const;
void WriteXMLCommand(cmXMLElement&);
void WriteXMLResult(cmXMLElement&);
void WriteXMLLabels(cmXMLElement&);
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 6e8091b8f3..125d0034d3 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -300,7 +300,7 @@ void cmCTestMemCheckHandler::PopulateCustomVectors(cmMakefile* mf)
this->CustomTestsIgnore);
}
-int cmCTestMemCheckHandler::GetDefectCount()
+int cmCTestMemCheckHandler::GetDefectCount() const
{
return this->DefectCount;
}
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 7ab00dbd7a..b200c4394e 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -29,7 +29,7 @@ public:
void Initialize() override;
- int GetDefectCount();
+ int GetDefectCount() const;
protected:
int PreProcessHandler() override;
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index c7cbd34d15..1f220af39c 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -358,7 +358,7 @@ void cmProcess::ResetStartTime()
this->StartTime = std::chrono::steady_clock::now();
}
-cmProcess::Exception cmProcess::GetExitException()
+cmProcess::Exception cmProcess::GetExitException() const
{
auto exception = Exception::None;
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -430,7 +430,7 @@ cmProcess::Exception cmProcess::GetExitException()
return exception;
}
-std::string cmProcess::GetExitExceptionString()
+std::string cmProcess::GetExitExceptionString() const
{
std::string exception_str;
#if defined(_WIN32)
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index 9eec9526f5..a44aeb07c2 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -67,8 +67,8 @@ public:
Other
};
- Exception GetExitException();
- std::string GetExitExceptionString();
+ Exception GetExitException() const;
+ std::string GetExitExceptionString() const;
std::unique_ptr<cmCTestRunTest> GetRunner()
{
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 6e1fac0f11..f32f9e93bb 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -951,6 +951,9 @@ void cmComputeLinkInformation::AddLinkExtension(std::string const& e,
}
}
+// XXX(clang-tidy): This method's const-ness is platform dependent, so we
+// cannot make it `const` as `clang-tidy` wants us to.
+// NOLINTNEXTLINE(readability-make-member-function-const)
std::string cmComputeLinkInformation::CreateExtensionRegex(
std::vector<std::string> const& exts, LinkType type)
{
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index d092f4f233..566c3bf78f 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -77,7 +77,7 @@ bool cmDepends::Check(const std::string& makeFile,
return okay;
}
-void cmDepends::Clear(const std::string& file)
+void cmDepends::Clear(const std::string& file) const
{
// Print verbose output.
if (this->Verbose) {
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index 0240da90b0..68759025a3 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -70,7 +70,7 @@ public:
DependencyMap& validDeps);
/** Clear dependencies for the target file so they will be regenerated. */
- void Clear(const std::string& file);
+ void Clear(const std::string& file) const;
/** Set the file comparison object */
void SetFileTimeCache(cmFileTimeCache* fc) { this->FileTimeCache = fc; }
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index fc1bbdd96b..0c5d310e30 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -103,7 +103,7 @@ void cmDependsJavaParserHelper::SafePrintMissing(const char* str, int line,
std::cout << "- " << strlen(str) << std::endl;
}
}
-void cmDependsJavaParserHelper::Print(const char* place, const char* str)
+void cmDependsJavaParserHelper::Print(const char* place, const char* str) const
{
if (this->Verbose) {
std::cout << "[" << place << "=" << str << "]" << std::endl;
diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h
index 869b7d4e46..4057bb7e35 100644
--- a/Source/cmDependsJavaParserHelper.h
+++ b/Source/cmDependsJavaParserHelper.h
@@ -85,7 +85,7 @@ private:
void PrintClasses();
- void Print(const char* place, const char* str);
+ void Print(const char* place, const char* str) const;
void CombineUnions(char** out, const char* in1, char** in2, const char* sep);
void SafePrintMissing(const char* str, int line, int cnt);
diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h
index 54dd6a4d11..919e4926e3 100644
--- a/Source/cmExprParserHelper.h
+++ b/Source/cmExprParserHelper.h
@@ -27,7 +27,7 @@ public:
void SetResult(KWIML_INT_int64_t value);
- KWIML_INT_int64_t GetResult() { return this->Result; }
+ KWIML_INT_int64_t GetResult() const { return this->Result; }
const char* GetError() { return this->ErrorString.c_str(); }
diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h
index 2b125afcc7..94baea1fe8 100644
--- a/Source/cmFileLock.h
+++ b/Source/cmFileLock.h
@@ -57,7 +57,7 @@ private:
BOOL LockFile(DWORD flags);
#else
int File = -1;
- int LockFile(int cmd, int type);
+ int LockFile(int cmd, int type) const;
#endif
std::string Filename;
diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx
index 1456ea8c14..613c6eeb52 100644
--- a/Source/cmFileLockUnix.cxx
+++ b/Source/cmFileLockUnix.cxx
@@ -64,7 +64,7 @@ cmFileLockResult cmFileLock::LockWithTimeout(unsigned long seconds)
}
}
-int cmFileLock::LockFile(int cmd, int type)
+int cmFileLock::LockFile(int cmd, int type) const
{
struct ::flock lock;
lock.l_start = 0;
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index bece33ba7e..3fb082603e 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -80,8 +80,8 @@ std::string cmFindPathCommand::FindHeader()
return header;
}
-std::string cmFindPathCommand::FindHeaderInFramework(std::string const& file,
- std::string const& dir)
+std::string cmFindPathCommand::FindHeaderInFramework(
+ std::string const& file, std::string const& dir) const
{
std::string fileName = file;
std::string frameWorkName;
diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h
index b9fe67358e..6101ea1c00 100644
--- a/Source/cmFindPathCommand.h
+++ b/Source/cmFindPathCommand.h
@@ -29,7 +29,7 @@ public:
private:
std::string FindHeaderInFramework(std::string const& file,
- std::string const& dir);
+ std::string const& dir) const;
std::string FindHeader();
std::string FindNormalHeader(cmFindBaseDebugState& debug);
std::string FindFrameworkHeader(cmFindBaseDebugState& debug);
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index c15f4911c5..7c950cca12 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -134,13 +134,13 @@ public:
std::set<std::string>& emitted);
// Make tool supports dependency files generated by compiler
- bool SupportsCompilerDependencies()
+ bool SupportsCompilerDependencies() const
{
return this->ToolSupportsCompilerDependencies;
}
// Make tool supports long line dependencies
- bool SupportsLongLineDependencies()
+ bool SupportsLongLineDependencies() const
{
return this->ToolSupportsLongLineDependencies;
}
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index ff08ee41ef..b04ad0cefb 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -57,28 +57,38 @@ public:
bool MakeFilesFullPath(const char* modeName,
const std::vector<std::string>& relFiles,
std::vector<std::string>& absFiles);
- bool CheckCMP0006(bool& failure);
+ bool CheckCMP0006(bool& failure) const;
std::string GetDestination(const cmInstallCommandArguments* args,
const std::string& varName,
- const std::string& guess);
- std::string GetRuntimeDestination(const cmInstallCommandArguments* args);
- std::string GetSbinDestination(const cmInstallCommandArguments* args);
- std::string GetArchiveDestination(const cmInstallCommandArguments* args);
- std::string GetLibraryDestination(const cmInstallCommandArguments* args);
- std::string GetIncludeDestination(const cmInstallCommandArguments* args);
- std::string GetSysconfDestination(const cmInstallCommandArguments* args);
- std::string GetSharedStateDestination(const cmInstallCommandArguments* args);
- std::string GetLocalStateDestination(const cmInstallCommandArguments* args);
- std::string GetRunStateDestination(const cmInstallCommandArguments* args);
- std::string GetDataRootDestination(const cmInstallCommandArguments* args);
- std::string GetDataDestination(const cmInstallCommandArguments* args);
- std::string GetInfoDestination(const cmInstallCommandArguments* args);
- std::string GetLocaleDestination(const cmInstallCommandArguments* args);
- std::string GetManDestination(const cmInstallCommandArguments* args);
- std::string GetDocDestination(const cmInstallCommandArguments* args);
+ const std::string& guess) const;
+ std::string GetRuntimeDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetSbinDestination(const cmInstallCommandArguments* args) const;
+ std::string GetArchiveDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetLibraryDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetIncludeDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetSysconfDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetSharedStateDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetLocalStateDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetRunStateDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetDataRootDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetDataDestination(const cmInstallCommandArguments* args) const;
+ std::string GetInfoDestination(const cmInstallCommandArguments* args) const;
+ std::string GetLocaleDestination(
+ const cmInstallCommandArguments* args) const;
+ std::string GetManDestination(const cmInstallCommandArguments* args) const;
+ std::string GetDocDestination(const cmInstallCommandArguments* args) const;
std::string GetDestinationForType(const cmInstallCommandArguments* args,
- const std::string& type);
+ const std::string& type) const;
cmExecutionStatus& Status;
cmMakefile* Makefile;
@@ -1477,7 +1487,7 @@ bool Helper::MakeFilesFullPath(const char* modeName,
return true;
}
-bool Helper::CheckCMP0006(bool& failure)
+bool Helper::CheckCMP0006(bool& failure) const
{
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0006)) {
case cmPolicies::WARN:
@@ -1504,7 +1514,7 @@ bool Helper::CheckCMP0006(bool& failure)
std::string Helper::GetDestination(const cmInstallCommandArguments* args,
const std::string& varName,
- const std::string& guess)
+ const std::string& guess) const
{
if (args && !args->GetDestination().empty()) {
return args->GetDestination();
@@ -1517,54 +1527,55 @@ std::string Helper::GetDestination(const cmInstallCommandArguments* args,
}
std::string Helper::GetRuntimeDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_BINDIR", "bin");
}
-std::string Helper::GetSbinDestination(const cmInstallCommandArguments* args)
+std::string Helper::GetSbinDestination(
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_SBINDIR", "sbin");
}
std::string Helper::GetArchiveDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_LIBDIR", "lib");
}
std::string Helper::GetLibraryDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_LIBDIR", "lib");
}
std::string Helper::GetIncludeDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_INCLUDEDIR", "include");
}
std::string Helper::GetSysconfDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_SYSCONFDIR", "etc");
}
std::string Helper::GetSharedStateDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_SHAREDSTATEDIR", "com");
}
std::string Helper::GetLocalStateDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_LOCALSTATEDIR", "var");
}
std::string Helper::GetRunStateDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_RUNSTATEDIR",
this->GetLocalStateDestination(nullptr) +
@@ -1572,44 +1583,49 @@ std::string Helper::GetRunStateDestination(
}
std::string Helper::GetDataRootDestination(
- const cmInstallCommandArguments* args)
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_DATAROOTDIR", "share");
}
-std::string Helper::GetDataDestination(const cmInstallCommandArguments* args)
+std::string Helper::GetDataDestination(
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_DATADIR",
this->GetDataRootDestination(nullptr));
}
-std::string Helper::GetInfoDestination(const cmInstallCommandArguments* args)
+std::string Helper::GetInfoDestination(
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_INFODIR",
this->GetDataRootDestination(nullptr) + "/info");
}
-std::string Helper::GetLocaleDestination(const cmInstallCommandArguments* args)
+std::string Helper::GetLocaleDestination(
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_LOCALEDIR",
this->GetDataRootDestination(nullptr) +
"/locale");
}
-std::string Helper::GetManDestination(const cmInstallCommandArguments* args)
+std::string Helper::GetManDestination(
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_MANDIR",
this->GetDataRootDestination(nullptr) + "/man");
}
-std::string Helper::GetDocDestination(const cmInstallCommandArguments* args)
+std::string Helper::GetDocDestination(
+ const cmInstallCommandArguments* args) const
{
return this->GetDestination(args, "CMAKE_INSTALL_DOCDIR",
this->GetDataRootDestination(nullptr) + "/doc");
}
std::string Helper::GetDestinationForType(
- const cmInstallCommandArguments* args, const std::string& type)
+ const cmInstallCommandArguments* args, const std::string& type) const
{
if (args && !args->GetDestination().empty()) {
return args->GetDestination();
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx
index ce2472d077..5b017914af 100644
--- a/Source/cmInstallScriptGenerator.cxx
+++ b/Source/cmInstallScriptGenerator.cxx
@@ -53,9 +53,8 @@ bool cmInstallScriptGenerator::Compute(cmLocalGenerator* lg)
return true;
}
-void cmInstallScriptGenerator::AddScriptInstallRule(std::ostream& os,
- Indent indent,
- std::string const& script)
+void cmInstallScriptGenerator::AddScriptInstallRule(
+ std::ostream& os, Indent indent, std::string const& script) const
{
if (this->Code) {
os << indent << script << "\n";
diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h
index 338d866ef8..f7ee3f9a15 100644
--- a/Source/cmInstallScriptGenerator.h
+++ b/Source/cmInstallScriptGenerator.h
@@ -30,7 +30,7 @@ protected:
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
Indent indent) override;
void AddScriptInstallRule(std::ostream& os, Indent indent,
- std::string const& script);
+ std::string const& script) const;
std::string const Script;
bool const Code;
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 36a1372132..1464a14cc5 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -30,7 +30,7 @@ struct cmListFileParser
bool ParseFunction(const char* name, long line);
bool AddArgument(cmListFileLexer_Token* token,
cmListFileArgument::Delimiter delim);
- cm::optional<cmListFileContext> CheckNesting();
+ cm::optional<cmListFileContext> CheckNesting() const;
cmListFile* ListFile;
cmListFileBacktrace Backtrace;
cmMessenger* Messenger;
@@ -352,7 +352,7 @@ bool TopIs(std::vector<NestingState>& stack, NestingStateEnum state)
}
}
-cm::optional<cmListFileContext> cmListFileParser::CheckNesting()
+cm::optional<cmListFileContext> cmListFileParser::CheckNesting() const
{
std::vector<NestingState> stack;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index a6d898d6b8..9248cbbd16 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2772,7 +2772,7 @@ inline void RegisterUnitySources(cmGeneratorTarget* target, cmSourceFile* sf,
void cmLocalGenerator::IncludeFileInUnitySources(
cmGeneratedFileStream& unity_file, std::string const& sf_full_path,
- cmProp beforeInclude, cmProp afterInclude, cmProp uniqueIdName)
+ cmProp beforeInclude, cmProp afterInclude, cmProp uniqueIdName) const
{
if (uniqueIdName && !uniqueIdName->empty()) {
std::string pathToHash;
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index a3610fdc13..7e4d590b59 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -656,7 +656,7 @@ private:
void IncludeFileInUnitySources(cmGeneratedFileStream& unity_file,
std::string const& sf_full_path,
cmProp beforeInclude, cmProp afterInclude,
- cmProp uniqueIdName);
+ cmProp uniqueIdName) const;
std::vector<std::string> AddUnityFilesModeAuto(
cmGeneratorTarget* target, std::string const& lang,
std::vector<cmSourceFile*> const& filtered_sources, cmProp beforeInclude,
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index e03a5674c3..b016530099 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -23,7 +23,7 @@
#include "cmSystemTools.h"
std::string cmTimestamp::CurrentTime(const std::string& formatString,
- bool utcFlag)
+ bool utcFlag) const
{
time_t currentTimeT = time(nullptr);
std::string source_date_epoch;
@@ -45,7 +45,7 @@ std::string cmTimestamp::CurrentTime(const std::string& formatString,
std::string cmTimestamp::FileModificationTime(const char* path,
const std::string& formatString,
- bool utcFlag)
+ bool utcFlag) const
{
std::string real_path =
cmSystemTools::GetRealPathResolvingWindowsSubst(path);
diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h
index 8941abe1c1..0e2c20006e 100644
--- a/Source/cmTimestamp.h
+++ b/Source/cmTimestamp.h
@@ -14,11 +14,11 @@
class cmTimestamp
{
public:
- std::string CurrentTime(const std::string& formatString, bool utcFlag);
+ std::string CurrentTime(const std::string& formatString, bool utcFlag) const;
std::string FileModificationTime(const char* path,
const std::string& formatString,
- bool utcFlag);
+ bool utcFlag) const;
std::string CreateTimestampFromTimeT(time_t timeT, std::string formatString,
bool utcFlag) const;
diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx
index f2c091f64b..7971009c84 100644
--- a/Source/cmWorkerPool.cxx
+++ b/Source/cmWorkerPool.cxx
@@ -170,9 +170,9 @@ public:
private:
// -- Libuv callbacks
static void UVExit(uv_process_t* handle, int64_t exitStatus, int termSignal);
- void UVPipeOutData(cmUVPipeBuffer::DataRange data);
+ void UVPipeOutData(cmUVPipeBuffer::DataRange data) const;
void UVPipeOutEnd(ssize_t error);
- void UVPipeErrData(cmUVPipeBuffer::DataRange data);
+ void UVPipeErrData(cmUVPipeBuffer::DataRange data) const;
void UVPipeErrEnd(ssize_t error);
void UVTryFinish();
@@ -330,7 +330,7 @@ void cmUVReadOnlyProcess::UVExit(uv_process_t* handle, int64_t exitStatus,
}
}
-void cmUVReadOnlyProcess::UVPipeOutData(cmUVPipeBuffer::DataRange data)
+void cmUVReadOnlyProcess::UVPipeOutData(cmUVPipeBuffer::DataRange data) const
{
this->Result()->StdOut.append(data.begin(), data.end());
}
@@ -346,7 +346,7 @@ void cmUVReadOnlyProcess::UVPipeOutEnd(ssize_t error)
this->UVTryFinish();
}
-void cmUVReadOnlyProcess::UVPipeErrData(cmUVPipeBuffer::DataRange data)
+void cmUVReadOnlyProcess::UVPipeErrData(cmUVPipeBuffer::DataRange data) const
{
std::string* str = this->Setup_.MergedOutput ? &this->Result()->StdOut
: &this->Result()->StdErr;
diff --git a/Source/cmXMLSafe.cxx b/Source/cmXMLSafe.cxx
index 8cd5f6e0d2..d31a239c73 100644
--- a/Source/cmXMLSafe.cxx
+++ b/Source/cmXMLSafe.cxx
@@ -28,7 +28,7 @@ cmXMLSafe& cmXMLSafe::Quotes(bool b)
return *this;
}
-std::string cmXMLSafe::str()
+std::string cmXMLSafe::str() const
{
std::ostringstream ss;
ss << *this;
diff --git a/Source/cmXMLSafe.h b/Source/cmXMLSafe.h
index 9b4c539e5b..21bd19aeef 100644
--- a/Source/cmXMLSafe.h
+++ b/Source/cmXMLSafe.h
@@ -24,7 +24,7 @@ public:
cmXMLSafe& Quotes(bool b = true);
/** Get the escaped data as a string. */
- std::string str();
+ std::string str() const;
private:
char const* Data;
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index 0fd6cfbfd2..0ebe00e7d4 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -127,7 +127,7 @@ private:
exit(1);
}
- bool IsWhitespace()
+ bool IsWhitespace() const
{
return (this->C == ' ' || this->C == '\t' || this->C == '\n' ||
this->C == '\r');