summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx137
1 files changed, 70 insertions, 67 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3668c82..c7dd3e4 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -491,7 +491,7 @@ std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends(
if (i != this->SourceDepends.end()) {
return &i->second.Depends;
}
- return 0;
+ return CM_NULLPTR;
}
static void handleSystemIncludesDep(
@@ -802,7 +802,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
if (iter == this->SystemIncludesCache.end()) {
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", 0, 0);
+ this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR);
bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED");
@@ -998,7 +998,8 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files,
this->DebugSourcesDone = true;
}
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "SOURCES", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "SOURCES",
+ CM_NULLPTR, CM_NULLPTR);
UNORDERED_SET<std::string> uniqueSrcs;
bool contextDependentDirectSources =
@@ -1506,7 +1507,7 @@ const char* cmGeneratorTarget::GetExportMacro() const
}
return this->ExportMacro.c_str();
} else {
- return 0;
+ return CM_NULLPTR;
}
}
@@ -1750,7 +1751,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
{
// There is no compile information for imported targets.
if (this->IsImported()) {
- return 0;
+ return CM_NULLPTR;
}
if (this->GetType() > cmState::OBJECT_LIBRARY) {
@@ -1759,7 +1760,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
msg += " which has type ";
msg += cmState::GetTargetTypeName(this->GetType());
this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
- return 0;
+ return CM_NULLPTR;
}
// Lookup/compute/cache the compile information for this configuration.
@@ -1788,7 +1789,7 @@ cmSourceFile const* cmGeneratorTarget::GetModuleDefinitionFile(
return data.front();
}
- return 0;
+ return CM_NULLPTR;
}
bool cmGeneratorTarget::IsDLLPlatform() const
@@ -1841,8 +1842,8 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result,
}
cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
- "AUTOUIC_OPTIONS", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this->GetName(), "AUTOUIC_OPTIONS", CM_NULLPTR, CM_NULLPTR);
cmSystemTools::ExpandListArgument(
ge.Parse(prop)->Evaluate(this->LocalGenerator, config, false, this,
&dagChecker),
@@ -1927,7 +1928,7 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target)
this->Makefile = target->Target->GetMakefile();
this->LocalGenerator = target->GetLocalGenerator();
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
- this->CurrentEntry = 0;
+ this->CurrentEntry = CM_NULLPTR;
// Queue all the source files already specified for the target.
if (target->GetType() != cmState::INTERFACE_LIBRARY) {
@@ -2002,7 +2003,7 @@ void cmTargetTraceDependencies::Trace()
this->CheckCustomCommand(*cc);
}
}
- this->CurrentEntry = 0;
+ this->CurrentEntry = CM_NULLPTR;
this->GeneratorTarget->AddTracedSources(this->NewSources);
}
@@ -2202,7 +2203,7 @@ std::string cmGeneratorTarget::GetCompilePDBDirectory(
void cmGeneratorTarget::GetAppleArchs(const std::string& config,
std::vector<std::string>& archVec) const
{
- const char* archs = 0;
+ const char* archs = CM_NULLPTR;
if (!config.empty()) {
std::string defVarName = "OSX_ARCHITECTURES_";
defVarName += cmSystemTools::UpperCase(config);
@@ -2360,8 +2361,8 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
std::vector<std::string> includes;
UNORDERED_SET<std::string> uniqueIncludes;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
- "INCLUDE_DIRECTORIES", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this->GetName(), "INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2487,8 +2488,8 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string>& result,
{
UNORDERED_SET<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
- "COMPILE_OPTIONS", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this->GetName(), "COMPILE_OPTIONS", CM_NULLPTR, CM_NULLPTR);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2539,8 +2540,8 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string>& result,
{
UNORDERED_SET<std::string> uniqueFeatures;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
- "COMPILE_FEATURES", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this->GetName(), "COMPILE_FEATURES", CM_NULLPTR, CM_NULLPTR);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2589,8 +2590,8 @@ void cmGeneratorTarget::GetCompileDefinitions(
{
UNORDERED_SET<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
- "COMPILE_DEFINITIONS", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this->GetName(), "COMPILE_DEFINITIONS", CM_NULLPTR, CM_NULLPTR);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2796,8 +2797,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
this->IsFrameworkOnApple()) {
// Versioning is supported only for shared libraries and modules,
// and then only when the platform supports an soname flag.
- version = 0;
- soversion = 0;
+ version = CM_NULLPTR;
+ soversion = CM_NULLPTR;
}
if (version && !soversion) {
// The soversion must be set if the library version is set. Use
@@ -2871,7 +2872,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
const char* version = this->GetProperty("VERSION");
if (this->GetType() != cmState::EXECUTABLE ||
this->Makefile->IsOn("XCODE")) {
- version = 0;
+ version = CM_NULLPTR;
}
#endif
@@ -2971,7 +2972,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
: this->GetProperty("PREFIX"));
const char* targetSuffix = (implib ? this->GetProperty("IMPORT_SUFFIX")
: this->GetProperty("SUFFIX"));
- const char* configPostfix = 0;
+ const char* configPostfix = CM_NULLPTR;
if (!config.empty()) {
std::string configProp = cmSystemTools::UpperCase(config);
configProp += "_POSTFIX";
@@ -2979,7 +2980,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
// Mac application bundles and frameworks have no postfix.
if (configPostfix &&
(this->IsAppBundleOnApple() || this->IsFrameworkOnApple())) {
- configPostfix = 0;
+ configPostfix = CM_NULLPTR;
}
}
const char* prefixVar = this->Target->GetPrefixVariableInternal(implib);
@@ -3013,14 +3014,14 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
fw_prefix = this->GetOutputName(config, false);
fw_prefix += ".framework/";
targetPrefix = fw_prefix.c_str();
- targetSuffix = 0;
+ targetSuffix = CM_NULLPTR;
}
if (this->IsCFBundleOnApple()) {
fw_prefix = this->GetCFBundleDirectory(config, false);
fw_prefix += "/";
targetPrefix = fw_prefix.c_str();
- targetSuffix = 0;
+ targetSuffix = CM_NULLPTR;
}
// Begin the final name with the prefix.
@@ -3269,7 +3270,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
switch (t) {
case BoolType:
assert(0 && "String compatibility check function called for boolean");
- return 0;
+ return CM_NULLPTR;
case StringType:
return tgt->GetLinkInterfaceDependentStringProperty(prop, config);
case NumberMinType:
@@ -3278,7 +3279,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
return tgt->GetLinkInterfaceDependentNumberMaxProperty(prop, config);
}
assert(0 && "Unreachable!");
- return 0;
+ return CM_NULLPTR;
}
template <typename PropertyType>
@@ -3316,7 +3317,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
}
if (emitted.insert(*pi).second) {
getLinkInterfaceDependentProperty<PropertyType>(depender, *pi, config, t,
- 0);
+ CM_NULLPTR);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
@@ -3394,24 +3395,25 @@ void cmGeneratorTarget::CheckPropertyCompatibility(
}
checkPropertyConsistency<bool>(this, li->Target, strBool, emittedBools,
- config, BoolType, 0);
+ config, BoolType, CM_NULLPTR);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
- checkPropertyConsistency<const char*>(
- this, li->Target, strString, emittedStrings, config, StringType, 0);
+ checkPropertyConsistency<const char*>(this, li->Target, strString,
+ emittedStrings, config, StringType,
+ CM_NULLPTR);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
checkPropertyConsistency<const char*>(this, li->Target, strNumMin,
emittedMinNumbers, config,
- NumberMinType, 0);
+ NumberMinType, CM_NULLPTR);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
checkPropertyConsistency<const char*>(this, li->Target, strNumMax,
emittedMaxNumbers, config,
- NumberMaxType, 0);
+ NumberMaxType, CM_NULLPTR);
if (cmSystemTools::GetErrorOccuredFlag()) {
return;
}
@@ -3544,7 +3546,7 @@ std::pair<bool, const char*> consistentStringProperty(const char* lhs,
const char* rhs)
{
const bool b = strcmp(lhs, rhs) == 0;
- return std::make_pair(b, b ? lhs : 0);
+ return std::make_pair(b, b ? lhs : CM_NULLPTR);
}
std::pair<bool, const char*> consistentNumberProperty(const char* lhs,
@@ -3553,7 +3555,7 @@ std::pair<bool, const char*> consistentNumberProperty(const char* lhs,
{
char* pEnd;
- const char* const null_ptr = 0;
+ const char* const null_ptr = CM_NULLPTR;
long lnum = strtol(lhs, &pEnd, 0);
if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE) {
@@ -3587,7 +3589,7 @@ std::pair<bool, const char*> consistentProperty(const char* lhs,
return std::make_pair(true, lhs);
}
- const char* const null_ptr = 0;
+ const char* const null_ptr = CM_NULLPTR;
switch (t) {
case BoolType:
@@ -3758,28 +3760,28 @@ bool cmGeneratorTarget::GetLinkInterfaceDependentBoolProperty(
const std::string& p, const std::string& config) const
{
return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE",
- BoolType, 0);
+ BoolType, CM_NULLPTR);
}
const char* cmGeneratorTarget::GetLinkInterfaceDependentStringProperty(
const std::string& p, const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char*>(
- this, p, config, "empty", StringType, 0);
+ this, p, config, "empty", StringType, CM_NULLPTR);
}
const char* cmGeneratorTarget::GetLinkInterfaceDependentNumberMinProperty(
const std::string& p, const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char*>(
- this, p, config, "empty", NumberMinType, 0);
+ this, p, config, "empty", NumberMinType, CM_NULLPTR);
}
const char* cmGeneratorTarget::GetLinkInterfaceDependentNumberMaxProperty(
const std::string& p, const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char*>(
- this, p, config, "empty", NumberMaxType, 0);
+ this, p, config, "empty", NumberMaxType, CM_NULLPTR);
}
cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation(
@@ -3794,7 +3796,7 @@ cmComputeLinkInformation* cmGeneratorTarget::GetLinkInformation(
new cmComputeLinkInformation(this, config);
if (!info || !info->Compute()) {
delete info;
- info = 0;
+ info = CM_NULLPTR;
}
// Store the information for this configuration.
@@ -3971,7 +3973,8 @@ void cmGeneratorTarget::ExpandLinkItems(
std::vector<cmLinkItem>& items, bool& hadHeadSensitiveCondition) const
{
cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, CM_NULLPTR,
+ CM_NULLPTR);
// The $<LINK_ONLY> expression may be in a link interface to specify private
// link dependencies that are otherwise excluded from usage requirements.
if (usage_requirements_only) {
@@ -3999,7 +4002,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
// export symbols.
if (this->GetType() == cmState::EXECUTABLE &&
!this->IsExecutableWithExports()) {
- return 0;
+ return CM_NULLPTR;
}
// Lookup any existing link interface for this configuration.
@@ -4023,7 +4026,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface(
}
}
- return iface.Exists ? &iface : 0;
+ return iface.Exists ? &iface : CM_NULLPTR;
}
void cmGeneratorTarget::ComputeLinkInterface(
@@ -4115,7 +4118,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries(
// export symbols.
if (this->GetType() == cmState::EXECUTABLE &&
!this->IsExecutableWithExports()) {
- return 0;
+ return CM_NULLPTR;
}
// Lookup any existing link interface for this configuration.
@@ -4138,7 +4141,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries(
usage_requirements_only);
}
- return iface.Exists ? &iface : 0;
+ return iface.Exists ? &iface : CM_NULLPTR;
}
std::string cmGeneratorTarget::GetDirectory(const std::string& config,
@@ -4167,7 +4170,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
{
// There is no output information for imported targets.
if (this->IsImported()) {
- return 0;
+ return CM_NULLPTR;
}
// Only libraries and executables have well-defined output files.
@@ -4177,7 +4180,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
msg += " which has type ";
msg += cmState::GetTargetTypeName(this->GetType());
this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
- return 0;
+ return CM_NULLPTR;
}
// Lookup/compute/cache the output information for this configuration.
@@ -4208,7 +4211,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
cmake::FATAL_ERROR,
"Target '" + this->GetName() + "' OUTPUT_DIRECTORY depends on itself.",
this->GetBacktrace());
- return 0;
+ return CM_NULLPTR;
}
return &i->second;
}
@@ -4222,7 +4225,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
// Look for a target property defining the target output directory
// based on the target type.
std::string targetTypeName = this->GetOutputTargetType(implib);
- const char* propertyName = 0;
+ const char* propertyName = CM_NULLPTR;
std::string propertyNameStr = targetTypeName;
if (!propertyNameStr.empty()) {
propertyNameStr += "_OUTPUT_DIRECTORY";
@@ -4231,7 +4234,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
// Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(conf);
- const char* configProp = 0;
+ const char* configProp = CM_NULLPTR;
std::string configPropStr = targetTypeName;
if (!configPropStr.empty()) {
configPropStr += "_OUTPUT_DIRECTORY_";
@@ -4299,7 +4302,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
{
// Look for a target property defining the target output directory
// based on the target type.
- const char* propertyName = 0;
+ const char* propertyName = CM_NULLPTR;
std::string propertyNameStr = kind;
if (!propertyNameStr.empty()) {
propertyNameStr += "_OUTPUT_DIRECTORY";
@@ -4309,7 +4312,7 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
// Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(conf);
- const char* configProp = 0;
+ const char* configProp = CM_NULLPTR;
std::string configPropStr = kind;
if (!configPropStr.empty()) {
configPropStr += "_OUTPUT_DIRECTORY_";
@@ -4367,7 +4370,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
// An explicit list of interface libraries may be set for shared
// libraries and executables that export symbols.
- const char* explicitLibraries = 0;
+ const char* explicitLibraries = CM_NULLPTR;
std::string linkIfaceProp;
if (this->GetPolicyStatusCMP0022() != cmPolicies::OLD &&
this->GetPolicyStatusCMP0022() != cmPolicies::WARN) {
@@ -4493,7 +4496,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
{
cmGeneratorTarget::ImportInfo const* info = this->GetImportInfo(config);
if (!info) {
- return 0;
+ return CM_NULLPTR;
}
std::string CONFIG = cmSystemTools::UpperCase(config);
@@ -4529,7 +4532,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo(
{
// There is no imported information for non-imported targets.
if (!this->IsImported()) {
- return 0;
+ return CM_NULLPTR;
}
// Lookup/compute/cache the import information for this
@@ -4555,7 +4558,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo(
// If the location is empty then the target is not available for
// this configuration.
if (i->second.Location.empty() && i->second.ImportLibrary.empty()) {
- return 0;
+ return CM_NULLPTR;
}
// Return the import information.
@@ -4572,8 +4575,8 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
// Initialize members.
info.NoSOName = false;
- const char* loc = 0;
- const char* imp = 0;
+ const char* loc = CM_NULLPTR;
+ const char* imp = CM_NULLPTR;
std::string suffix;
if (!this->Target->GetMappedConfig(desired_config, &loc, &imp, suffix)) {
return;
@@ -4715,7 +4718,7 @@ const cmLinkImplementation* cmGeneratorTarget::GetLinkImplementation(
{
// There is no link implementation for imported targets.
if (this->IsImported()) {
- return 0;
+ return CM_NULLPTR;
}
std::string CONFIG = cmSystemTools::UpperCase(config);
@@ -4944,7 +4947,7 @@ cmGeneratorTarget::GetLinkImplementationLibrariesInternal(
{
// There is no link implementation for imported targets.
if (this->IsImported()) {
- return 0;
+ return CM_NULLPTR;
}
// Populate the link implementation libraries for this configuration.
@@ -4984,8 +4987,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
end = entryRange.end();
le != end; ++le, ++btIt) {
std::vector<std::string> llibs;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
- "LINK_LIBRARIES", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this->GetName(), "LINK_LIBRARIES", CM_NULLPTR, CM_NULLPTR);
cmGeneratorExpression ge(*btIt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge = ge.Parse(*le);
std::string const evaluated =
@@ -5078,7 +5081,7 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink(
// within the project.
if (tgt && tgt->GetType() == cmState::EXECUTABLE &&
!tgt->IsExecutableWithExports()) {
- tgt = 0;
+ tgt = CM_NULLPTR;
}
if (tgt && tgt->GetType() == cmState::OBJECT_LIBRARY) {
@@ -5092,7 +5095,7 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink(
"with the ENABLE_EXPORTS property set.";
cmake* cm = this->LocalGenerator->GetCMakeInstance();
cm->IssueMessage(cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
- tgt = 0;
+ tgt = CM_NULLPTR;
}
return tgt;