summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-07-27 23:00:00 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-07-28 12:31:31 (GMT)
commitf37c14e93036fe01fca3539f539ff8821494e9d1 (patch)
treefc08ddab0c3e9b47f00cff9a287cc89a2afa13ca /Source/cmLocalGenerator.cxx
parent261a2585d9df7113a5ba7c9beacb641754444523 (diff)
downloadCMake-f37c14e93036fe01fca3539f539ff8821494e9d1.zip
CMake-f37c14e93036fe01fca3539f539ff8821494e9d1.tar.gz
CMake-f37c14e93036fe01fca3539f539ff8821494e9d1.tar.bz2
Source: use cmNonempty()
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 646cf5e..4c9744f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -221,7 +221,7 @@ void cmLocalGenerator::ComputeObjectMaxPath()
this->ObjectPathMax = 1000;
#endif
const char* plen = this->Makefile->GetDefinition("CMAKE_OBJECT_PATH_MAX");
- if (plen && *plen) {
+ if (cmNonempty(plen)) {
unsigned int pmax;
if (sscanf(plen, "%u", &pmax) == 1) {
if (pmax >= 128) {
@@ -434,7 +434,7 @@ void cmLocalGenerator::GenerateInstallRules()
prefix_win32 = "C:";
}
const char* project_name = this->Makefile->GetDefinition("PROJECT_NAME");
- if (project_name && project_name[0]) {
+ if (cmNonempty(project_name)) {
prefix_win32 += "/Program Files/";
prefix_win32 += project_name;
} else {
@@ -893,7 +893,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
emitted.insert("/System/Library/Frameworks");
#endif
for (std::string const& i : includes) {
- if (fwSearchFlag && *fwSearchFlag && this->Makefile->IsOn("APPLE") &&
+ if (cmNonempty(fwSearchFlag) && this->Makefile->IsOn("APPLE") &&
cmSystemTools::IsPathToFramework(i)) {
std::string const frameworkDir =
cmSystemTools::CollapseFullPath(cmStrCat(i, "/../"));
@@ -1653,7 +1653,7 @@ static std::string GetFrameworkFlags(const std::string& lang,
std::string fwSearchFlagVar = "CMAKE_" + lang + "_FRAMEWORK_SEARCH_FLAG";
const char* fwSearchFlag = mf->GetDefinition(fwSearchFlagVar);
- if (!(fwSearchFlag && *fwSearchFlag)) {
+ if (!cmNonempty(fwSearchFlag)) {
return std::string();
}
@@ -1892,7 +1892,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
std::string sysrootFlagVar =
std::string("CMAKE_") + lang + "_SYSROOT_FLAG";
const char* sysrootFlag = this->Makefile->GetDefinition(sysrootFlagVar);
- if (sysrootFlag && *sysrootFlag) {
+ if (cmNonempty(sysrootFlag)) {
if (!this->AppleArchSysroots.empty() &&
!this->AllAppleArchSysrootsAreTheSame(archs, sysroot)) {
for (std::string const& arch : archs) {
@@ -1921,8 +1921,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
std::string("CMAKE_") + lang + "_OSX_DEPLOYMENT_TARGET_FLAG";
const char* deploymentTargetFlag =
this->Makefile->GetDefinition(deploymentTargetFlagVar);
- if (deploymentTargetFlag && *deploymentTargetFlag && deploymentTarget &&
- *deploymentTarget) {
+ if (cmNonempty(deploymentTargetFlag) && cmNonempty(deploymentTarget)) {
flags += " ";
flags += deploymentTargetFlag;
flags += deploymentTarget;
@@ -3062,7 +3061,7 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines,
if (!lang.empty()) {
const char* df =
this->Makefile->GetDefinition(cmStrCat("CMAKE_", lang, "_DEFINE_FLAG"));
- if (df && *df) {
+ if (cmNonempty(df)) {
dflag = df;
}
}