diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/Checks/cm_cxx_features.cmake | 2 | ||||
-rw-r--r-- | Source/cmAlgorithms.h | 54 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 74 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 226 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 12 | ||||
-rw-r--r-- | Source/cmInstallCommand.cxx | 6 | ||||
-rw-r--r-- | Source/cmcmd.cxx | 4 |
8 files changed, 272 insertions, 108 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0a5c247..c9707e1 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 14) -set(CMake_VERSION_PATCH 20190308) +set(CMake_VERSION_PATCH 20190314) #set(CMake_VERSION_RC 1) diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index d941c16..fb68ed7 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -27,7 +27,7 @@ function(cm_check_cxx_feature name) # Filter out xcodebuild warnings. string(REGEX REPLACE "[^\n]* xcodebuild\\[[0-9]*:[0-9]*\\] warning: [^\n]*" "" check_output "${check_output}") # If using the feature causes warnings, treat it as broken/unavailable. - if(check_output MATCHES "[Ww]arning") + if(check_output MATCHES "(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]") set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE) endif() if(CMake_HAVE_CXX_${FEATURE}) diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index 2ff1ed0..0980416 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -233,27 +233,45 @@ typename Range::const_iterator cmRemoveMatching(Range& r, MatchRange const& m) ContainerAlgorithms::BinarySearcher<MatchRange>(m)); } -template <typename Range> -typename Range::const_iterator cmRemoveDuplicates(Range& r) +template <typename ForwardIterator> +ForwardIterator cmRemoveDuplicates(ForwardIterator first, ForwardIterator last) { - typedef typename Range::value_type T; - std::unordered_set<T> unique; - std::vector<size_t> indices; - size_t count = 0; - const typename Range::const_iterator end = r.end(); - for (typename Range::const_iterator it = r.begin(); it != end; - ++it, ++count) { - const typename std::unordered_set<T>::iterator occur = unique.find(*it); - if (occur == unique.end()) { - unique.insert(*it); - } else { - indices.push_back(count); + using Value = typename std::iterator_traits<ForwardIterator>::value_type; + using Hash = struct + { + std::size_t operator()(ForwardIterator it) const + { + return std::hash<Value>{}(*it); } + }; + + using Equal = struct + { + bool operator()(ForwardIterator it1, ForwardIterator it2) const + { + return *it1 == *it2; + } + }; + std::unordered_set<ForwardIterator, Hash, Equal> uniq; + + ForwardIterator result = first; + while (first != last) { + if (uniq.find(first) == uniq.end()) { + if (result != first) { + *result = std::move(*first); + } + uniq.insert(result); + ++result; + } + ++first; } - if (indices.empty()) { - return end; - } - return cmRemoveIndices(r, indices); + return result; +} + +template <typename Range> +typename Range::const_iterator cmRemoveDuplicates(Range& r) +{ + return cmRemoveDuplicates(r.begin(), r.end()); } template <typename Range> diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index ce308cc..50413c8 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -15,6 +15,8 @@ #include "cmMessageType.h" #include "cmOutputConverter.h" #include "cmPolicies.h" +#include "cmState.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -690,6 +692,28 @@ static const struct CXXCompilerIdNode : public CompilerIdNode } } cxxCompilerIdNode; +static const struct CUDACompilerIdNode : public CompilerIdNode +{ + CUDACompilerIdNode() {} // NOLINT(modernize-use-equals-default) + + std::string Evaluate( + const std::vector<std::string>& parameters, + cmGeneratorExpressionContext* context, + const GeneratorExpressionContent* content, + cmGeneratorExpressionDAGChecker* dagChecker) const override + { + if (!context->HeadTarget) { + reportError( + context, content->GetOriginalExpression(), + "$<CUDA_COMPILER_ID> may only be used with binary targets. It may " + "not be used with add_custom_command or add_custom_target."); + return std::string(); + } + return this->EvaluateWithLanguage(parameters, context, content, dagChecker, + "CUDA"); + } +} cudaCompilerIdNode; + static const struct FortranCompilerIdNode : public CompilerIdNode { FortranCompilerIdNode() {} // NOLINT(modernize-use-equals-default) @@ -771,9 +795,9 @@ static const struct CCompilerVersionNode : public CompilerVersionNode } } cCompilerVersionNode; -static const struct CxxCompilerVersionNode : public CompilerVersionNode +static const struct CXXCompilerVersionNode : public CompilerVersionNode { - CxxCompilerVersionNode() {} // NOLINT(modernize-use-equals-default) + CXXCompilerVersionNode() {} // NOLINT(modernize-use-equals-default) std::string Evaluate( const std::vector<std::string>& parameters, @@ -793,6 +817,28 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode } } cxxCompilerVersionNode; +static const struct CUDACompilerVersionNode : public CompilerVersionNode +{ + CUDACompilerVersionNode() {} // NOLINT(modernize-use-equals-default) + + std::string Evaluate( + const std::vector<std::string>& parameters, + cmGeneratorExpressionContext* context, + const GeneratorExpressionContent* content, + cmGeneratorExpressionDAGChecker* dagChecker) const override + { + if (!context->HeadTarget) { + reportError( + context, content->GetOriginalExpression(), + "$<CUDA_COMPILER_VERSION> may only be used with binary targets. It " + "may not be used with add_custom_command or add_custom_target."); + return std::string(); + } + return this->EvaluateWithLanguage(parameters, context, content, dagChecker, + "CUDA"); + } +} cudaCompilerVersionNode; + static const struct FortranCompilerVersionNode : public CompilerVersionNode { FortranCompilerVersionNode() {} // NOLINT(modernize-use-equals-default) @@ -2045,13 +2091,27 @@ static const struct ShellPathNode : public cmGeneratorExpressionNode const GeneratorExpressionContent* content, cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override { - if (!cmSystemTools::FileIsFullPath(parameters.front())) { + std::vector<std::string> listIn; + cmSystemTools::ExpandListArgument(parameters.front(), listIn); + if (listIn.empty()) { reportError(context, content->GetOriginalExpression(), - "\"" + parameters.front() + "\" is not an absolute path."); + "\"\" is not an absolute path."); return std::string(); } - cmOutputConverter converter(context->LG->GetStateSnapshot()); - return converter.ConvertDirectorySeparatorsForShell(parameters.front()); + cmStateSnapshot snapshot = context->LG->GetStateSnapshot(); + cmOutputConverter converter(snapshot); + const char* separator = snapshot.GetState()->UseWindowsShell() ? ";" : ":"; + std::vector<std::string> listOut; + listOut.reserve(listIn.size()); + for (auto const& in : listIn) { + if (!cmSystemTools::FileIsFullPath(in)) { + reportError(context, content->GetOriginalExpression(), + "\"" + in + "\" is not an absolute path."); + return std::string(); + } + listOut.emplace_back(converter.ConvertDirectorySeparatorsForShell(in)); + } + return cmJoin(listOut, separator); } } shellPathNode; @@ -2066,6 +2126,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode( { "NOT", ¬Node }, { "C_COMPILER_ID", &cCompilerIdNode }, { "CXX_COMPILER_ID", &cxxCompilerIdNode }, + { "CUDA_COMPILER_ID", &cudaCompilerIdNode }, { "Fortran_COMPILER_ID", &fortranCompilerIdNode }, { "VERSION_GREATER", &versionGreaterNode }, { "VERSION_GREATER_EQUAL", &versionGreaterEqNode }, @@ -2074,6 +2135,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode( { "VERSION_EQUAL", &versionEqualNode }, { "C_COMPILER_VERSION", &cCompilerVersionNode }, { "CXX_COMPILER_VERSION", &cxxCompilerVersionNode }, + { "CUDA_COMPILER_VERSION", &cudaCompilerVersionNode }, { "Fortran_COMPILER_VERSION", &fortranCompilerVersionNode }, { "PLATFORM_ID", &platformIdNode }, { "COMPILE_FEATURES", &compileFeaturesNode }, diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 624333c..5916fcc 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -65,20 +65,137 @@ const char* cmTargetPropertyComputer::ComputeLocation<cmGeneratorTarget>( class cmGeneratorTarget::TargetPropertyEntry { +protected: static cmLinkImplItem NoLinkImplItem; public: - TargetPropertyEntry(std::unique_ptr<cmCompiledGeneratorExpression> cge, - cmLinkImplItem const& item = NoLinkImplItem) - : ge(std::move(cge)) - , LinkImplItem(item) + TargetPropertyEntry(cmLinkImplItem const& item) + : LinkImplItem(item) { } - const std::unique_ptr<cmCompiledGeneratorExpression> ge; + virtual ~TargetPropertyEntry() = default; + + virtual const std::string& Evaluate( + cmLocalGenerator* lg, const std::string& config, bool quiet = false, + cmGeneratorTarget const* headTarget = nullptr, + cmGeneratorTarget const* currentTarget = nullptr, + cmGeneratorExpressionDAGChecker* dagChecker = nullptr, + std::string const& language = std::string()) const = 0; + virtual const std::string& Evaluate( + cmLocalGenerator* lg, const std::string& config, bool quiet, + cmGeneratorTarget const* headTarget, + cmGeneratorExpressionDAGChecker* dagChecker, + std::string const& language = std::string()) const = 0; + + virtual cmListFileBacktrace GetBacktrace() const = 0; + virtual std::string const& GetInput() const = 0; + virtual bool GetHadContextSensitiveCondition() const { return false; } + cmLinkImplItem const& LinkImplItem; + +private: + cmListFileBacktrace Backtrace; }; cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem; +class TargetPropertyEntryGenex : public cmGeneratorTarget::TargetPropertyEntry +{ +public: + TargetPropertyEntryGenex(std::unique_ptr<cmCompiledGeneratorExpression> cge, + cmLinkImplItem const& item = NoLinkImplItem) + : cmGeneratorTarget::TargetPropertyEntry(item) + , ge(std::move(cge)) + { + } + + const std::string& Evaluate( + cmLocalGenerator* lg, const std::string& config, bool quiet = false, + cmGeneratorTarget const* headTarget = nullptr, + cmGeneratorTarget const* currentTarget = nullptr, + cmGeneratorExpressionDAGChecker* dagChecker = nullptr, + std::string const& language = std::string()) const override + { + return this->ge->Evaluate(lg, config, quiet, headTarget, currentTarget, + dagChecker, language); + } + const std::string& Evaluate( + cmLocalGenerator* lg, const std::string& config, bool quiet, + cmGeneratorTarget const* headTarget, + cmGeneratorExpressionDAGChecker* dagChecker, + std::string const& language = std::string()) const override + { + return this->ge->Evaluate(lg, config, quiet, headTarget, dagChecker, + language); + } + + cmListFileBacktrace GetBacktrace() const override + { + return this->ge->GetBacktrace(); + } + + std::string const& GetInput() const override { return this->ge->GetInput(); } + + bool GetHadContextSensitiveCondition() const override + { + return this->ge->GetHadContextSensitiveCondition(); + } + +private: + const std::unique_ptr<cmCompiledGeneratorExpression> ge; +}; + +class TargetPropertyEntryString : public cmGeneratorTarget::TargetPropertyEntry +{ +public: + TargetPropertyEntryString(std::string propertyValue, + cmListFileBacktrace backtrace, + cmLinkImplItem const& item = NoLinkImplItem) + : cmGeneratorTarget::TargetPropertyEntry(item) + , PropertyValue(std::move(propertyValue)) + , Backtrace(std::move(backtrace)) + { + } + + const std::string& Evaluate(cmLocalGenerator*, const std::string&, bool, + cmGeneratorTarget const*, + cmGeneratorTarget const*, + cmGeneratorExpressionDAGChecker*, + std::string const&) const override + { + return this->PropertyValue; + } + const std::string& Evaluate(cmLocalGenerator*, const std::string&, bool, + cmGeneratorTarget const*, + cmGeneratorExpressionDAGChecker*, + std::string const&) const override + { + return this->PropertyValue; + } + + cmListFileBacktrace GetBacktrace() const override { return this->Backtrace; } + std::string const& GetInput() const override { return this->PropertyValue; } + +private: + std::string PropertyValue; + cmListFileBacktrace Backtrace; +}; + +cmGeneratorTarget::TargetPropertyEntry* CreateTargetPropertyEntry( + const std::string& propertyValue, + cmListFileBacktrace backtrace = cmListFileBacktrace(), + bool evaluateForBuildsystem = false) +{ + if (cmGeneratorExpression::Find(propertyValue) != std::string::npos) { + cmGeneratorExpression ge(std::move(backtrace)); + std::unique_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(propertyValue); + cge->SetEvaluateForBuildsystem(evaluateForBuildsystem); + return new TargetPropertyEntryGenex(std::move(cge)); + } + + return new TargetPropertyEntryString(propertyValue, backtrace); +} + void CreatePropertyGeneratorExpressions( cmStringRange entries, cmBacktraceRange backtraces, std::vector<cmGeneratorTarget::TargetPropertyEntry*>& items, @@ -87,11 +204,8 @@ void CreatePropertyGeneratorExpressions( std::vector<cmListFileBacktrace>::const_iterator btIt = backtraces.begin(); for (std::vector<std::string>::const_iterator it = entries.begin(); it != entries.end(); ++it, ++btIt) { - cmGeneratorExpression ge(*btIt); - std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it); - cge->SetEvaluateForBuildsystem(evaluateForBuildsystem); items.push_back( - new cmGeneratorTarget::TargetPropertyEntry(std::move(cge))); + CreateTargetPropertyEntry(*it, *btIt, evaluateForBuildsystem)); } } @@ -167,7 +281,7 @@ const char* cmGeneratorTarget::GetSourcesProperty() const { std::vector<std::string> values; for (TargetPropertyEntry* se : this->SourceEntries) { - values.push_back(se->ge->GetInput()); + values.push_back(se->GetInput()); } static std::string value; value.clear(); @@ -359,13 +473,9 @@ void cmGeneratorTarget::ClearSourcesCache() void cmGeneratorTarget::AddSourceCommon(const std::string& src, bool before) { - cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); - std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src); - cge->SetEvaluateForBuildsystem(true); - this->SourceEntries.insert(before ? this->SourceEntries.begin() - : this->SourceEntries.end(), - new TargetPropertyEntry(std::move(cge))); + this->SourceEntries.insert( + before ? this->SourceEntries.begin() : this->SourceEntries.end(), + CreateTargetPropertyEntry(src, this->Makefile->GetBacktrace(), true)); this->ClearSourcesCache(); } @@ -387,14 +497,10 @@ void cmGeneratorTarget::AddIncludeDirectory(const std::string& src, bool before) { this->Target->InsertInclude(src, this->Makefile->GetBacktrace(), before); - cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); - std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src); - cge->SetEvaluateForBuildsystem(true); this->IncludeDirectoriesEntries.insert( before ? this->IncludeDirectoriesEntries.begin() : this->IncludeDirectoriesEntries.end(), - new TargetPropertyEntry(std::move(cge))); + CreateTargetPropertyEntry(src, this->Makefile->GetBacktrace(), true)); } std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends( @@ -854,8 +960,7 @@ static void AddInterfaceEntries( cmGeneratorExpression ge(lib.Backtrace); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex); cge->SetEvaluateForBuildsystem(true); - entries.push_back( - new cmGeneratorTarget::TargetPropertyEntry(std::move(cge), lib)); + entries.push_back(new TargetPropertyEntryGenex(std::move(cge), lib)); } } } @@ -877,8 +982,7 @@ static void AddObjectEntries( cmGeneratorExpression ge(lib.Backtrace); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex); cge->SetEvaluateForBuildsystem(true); - entries.push_back( - new cmGeneratorTarget::TargetPropertyEntry(std::move(cge), lib)); + entries.push_back(new TargetPropertyEntryGenex(std::move(cge), lib)); } } } @@ -900,12 +1004,12 @@ static bool processSources( cmLinkImplItem const& item = entry->LinkImplItem; std::string const& targetName = item.AsStr(); std::vector<std::string> entrySources; - cmSystemTools::ExpandListArgument( - entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt, tgt, - dagChecker), - entrySources); + cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), + config, false, tgt, tgt, + dagChecker), + entrySources); - if (entry->ge->GetHadContextSensitiveCondition()) { + if (entry->GetHadContextSensitiveCondition()) { contextDependent = true; } @@ -940,7 +1044,7 @@ static bool processSources( std::string usedSources; for (std::string const& src : entrySources) { if (uniqueSrcs.insert(src).second) { - srcs.emplace_back(src, entry->ge->GetBacktrace()); + srcs.emplace_back(src, entry->GetBacktrace()); if (debugSources) { usedSources += " * " + src + "\n"; } @@ -951,7 +1055,7 @@ static bool processSources( MessageType::LOG, std::string("Used sources for target ") + tgt->GetName() + ":\n" + usedSources, - entry->ge->GetBacktrace()); + entry->GetBacktrace()); } } return contextDependent; @@ -2529,10 +2633,10 @@ static void processIncludeDirectories( bool const fromImported = item.Target && item.Target->IsImported(); bool const checkCMP0027 = item.FromGenex; std::vector<std::string> entryIncludes; - cmSystemTools::ExpandListArgument( - entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt, - dagChecker, language), - entryIncludes); + cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), + config, false, tgt, + dagChecker, language), + entryIncludes); std::string usedIncludes; for (std::string& entryInclude : entryIncludes) { @@ -2610,7 +2714,7 @@ static void processIncludeDirectories( std::string inc = entryInclude; if (uniqueIncludes.insert(inc).second) { - includes.emplace_back(inc, entry->ge->GetBacktrace()); + includes.emplace_back(inc, entry->GetBacktrace()); if (debugIncludes) { usedIncludes += " * " + inc + "\n"; } @@ -2621,7 +2725,7 @@ static void processIncludeDirectories( MessageType::LOG, std::string("Used includes for target ") + tgt->GetName() + ":\n" + usedIncludes, - entry->ge->GetBacktrace()); + entry->GetBacktrace()); } } } @@ -2673,11 +2777,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories( libDir = frameworkCheck.match(1); - cmGeneratorExpression ge; - std::unique_ptr<cmCompiledGeneratorExpression> cge = - ge.Parse(libDir.c_str()); linkInterfaceIncludeDirectoriesEntries.push_back( - new cmGeneratorTarget::TargetPropertyEntry(std::move(cge))); + CreateTargetPropertyEntry(libDir)); } } @@ -2707,10 +2808,10 @@ static void processOptionsInternal( { for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) { std::vector<std::string> entryOptions; - cmSystemTools::ExpandListArgument( - entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt, - dagChecker, language), - entryOptions); + cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), + config, false, tgt, + dagChecker, language), + entryOptions); std::string usedOptions; for (std::string const& opt : entryOptions) { if (uniqueOptions.insert(opt).second) { @@ -2719,10 +2820,10 @@ static void processOptionsInternal( std::vector<std::string> tmp; cmSystemTools::ParseUnixCommandLine(opt.c_str() + 6, tmp); for (std::string& o : tmp) { - options.emplace_back(std::move(o), entry->ge->GetBacktrace()); + options.emplace_back(std::move(o), entry->GetBacktrace()); } } else { - options.emplace_back(opt, entry->ge->GetBacktrace()); + options.emplace_back(opt, entry->GetBacktrace()); } if (debugOptions) { usedOptions += " * " + opt + "\n"; @@ -2734,7 +2835,7 @@ static void processOptionsInternal( MessageType::LOG, std::string("Used ") + logName + std::string(" for target ") + tgt->GetName() + ":\n" + usedOptions, - entry->ge->GetBacktrace()); + entry->GetBacktrace()); } } } @@ -2938,11 +3039,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileDefinitions( CM_FALLTHROUGH; } case cmPolicies::OLD: { - cmGeneratorExpression ge; - std::unique_ptr<cmCompiledGeneratorExpression> cge = - ge.Parse(configProp); linkInterfaceCompileDefinitionsEntries.push_back( - new cmGeneratorTarget::TargetPropertyEntry(std::move(cge))); + CreateTargetPropertyEntry(configProp)); } break; case cmPolicies::NEW: case cmPolicies::REQUIRED_ALWAYS: @@ -3168,12 +3266,9 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetStaticLibraryLinkOptions( if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { std::vector<std::string> options; - cmGeneratorExpression ge; cmSystemTools::ExpandListArgument(linkOptions, options); for (const auto& option : options) { - std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(option); - entries.push_back( - new cmGeneratorTarget::TargetPropertyEntry(std::move(cge))); + entries.push_back(CreateTargetPropertyEntry(option)); } } processStaticLibraryLinkOptions(this, entries, result, uniqueOptions, @@ -3197,10 +3292,10 @@ void processLinkDirectories( std::string const& targetName = item.AsStr(); std::vector<std::string> entryDirectories; - cmSystemTools::ExpandListArgument( - entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt, - dagChecker, language), - entryDirectories); + cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), + config, false, tgt, + dagChecker, language), + entryDirectories); std::string usedDirectories; for (std::string& entryDirectory : entryDirectories) { @@ -3256,7 +3351,7 @@ void processLinkDirectories( MessageType::LOG, std::string("Used link directories for target ") + tgt->GetName() + ":\n" + usedDirectories, - entry->ge->GetBacktrace()); + entry->GetBacktrace()); } } } @@ -3353,12 +3448,9 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDepends( if (const char* linkDepends = this->GetProperty("LINK_DEPENDS")) { std::vector<std::string> depends; - cmGeneratorExpression ge; cmSystemTools::ExpandListArgument(linkDepends, depends); for (const auto& depend : depends) { - std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depend); - linkDependsEntries.push_back( - new cmGeneratorTarget::TargetPropertyEntry(std::move(cge))); + linkDependsEntries.push_back(CreateTargetPropertyEntry(depend)); } } AddInterfaceEntries(this, config, "INTERFACE_LINK_DEPENDS", diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 94f6b68..391fe69 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -478,18 +478,6 @@ std::string cmGlobalVisualStudioVersionedGenerator::FindMSBuildCommand() // Ask Visual Studio Installer tool. std::string vs; if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) { - std::string const& hostArch = - this->GetPlatformToolsetHostArchitectureString(); - if (hostArch == "x64") { - msbuild = vs + "/MSBuild/Current/Bin/amd64/MSBuild.exe"; - if (cmSystemTools::FileExists(msbuild)) { - return msbuild; - } - msbuild = vs + "/MSBuild/15.0/Bin/amd64/MSBuild.exe"; - if (cmSystemTools::FileExists(msbuild)) { - return msbuild; - } - } msbuild = vs + "/MSBuild/Current/Bin/MSBuild.exe"; if (cmSystemTools::FileExists(msbuild)) { return msbuild; diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 8ef6441..20d1a31 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -402,7 +402,11 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) cmTarget* target = this->Makefile->FindLocalNonAliasTarget(tgt); if (!target) { // If no local target has been found, find it in the global scope. - target = this->Makefile->GetGlobalGenerator()->FindTarget(tgt, true); + cmTarget* const global_target = + this->Makefile->GetGlobalGenerator()->FindTarget(tgt, true); + if (global_target && !global_target->IsImported()) { + target = global_target; + } } if (target) { // Found the target. Check its type. diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index cefac7a..f996a3e 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -111,8 +111,8 @@ void CMakeCommandUsage(const char* program) << " tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n" << " - create or extract a tar or zip archive\n" << " time command [args...] - run command and display elapsed time\n" - << " touch file - touch a file.\n" - << " touch_nocreate file - touch a file but do not create it.\n" + << " touch <file>... - touch a <file>.\n" + << " touch_nocreate <file>... - touch a <file> but do not create it.\n" << " create_symlink old new - create a symbolic link new -> old\n" #if defined(_WIN32) && !defined(__CYGWIN__) << "Available on Windows only:\n" |