diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
| -rw-r--r-- | Source/cmLocalGenerator.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 028053d..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) { @@ -284,7 +284,7 @@ void cmLocalGenerator::TraceDependencies() // Generate the rule files for each target. const auto& targets = this->GetGeneratorTargets(); for (const auto& target : targets) { - if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { + if (!target->IsInBuildSystem()) { continue; } target->TraceDependencies(); @@ -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 { @@ -760,7 +760,7 @@ void cmLocalGenerator::ComputeTargetManifest() // Add our targets to the manifest for each configuration. const auto& targets = this->GetGeneratorTargets(); for (const auto& target : targets) { - if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { + if (!target->IsInBuildSystem()) { continue; } for (std::string const& c : configNames) { @@ -797,7 +797,7 @@ bool cmLocalGenerator::ComputeTargetCompileFeatures() // Now that C/C++ _STANDARD values have been computed // set the values to ObjC/ObjCXX _STANDARD variables - if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { + if (target->CanCompileSources()) { for (std::string const& c : configNames) { target->ComputeCompileFeatures(c, inferredEnabledLanguages); } @@ -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; } } |
