This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via e15a9187b04336b64c92bde0a6b879237193ac5f (commit) via de2c73d84f767e8d80ed310151384554506ff49b (commit) via 98972371e4a768c36d4169431392fe727dcac2ee (commit) via 9182b3ce5346ca0779f93d2f0cc2fbe8a1868b63 (commit) via 76b76a7f9bdf54c8dc299bd1a9c7bcc0bc9ef005 (commit) via c55fb044a9cf20a449f9d5ebc5d88c6de279786d (commit) via 86bf1eef7587b837057f098927fb6e7e10149c66 (commit) from 01c7c4236af7646c6b6db0a8a0d0e355b58c5bf2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e15a9187b04336b64c92bde0a6b879237193ac5f commit e15a9187b04336b64c92bde0a6b879237193ac5f Merge: de2c73d 76b76a7 Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed Aug 21 14:48:41 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Wed Aug 21 10:49:50 2019 -0400 Merge topic 'FindCUDA-nvcc-include-dir-backslash' 76b76a7f9b FindCUDA: Fix support for backslashes in CUDA_NVCC_INCLUDE_DIRS Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3679 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de2c73d84f767e8d80ed310151384554506ff49b commit de2c73d84f767e8d80ed310151384554506ff49b Merge: 9897237 c55fb04 Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed Aug 21 14:47:29 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Wed Aug 21 10:47:47 2019 -0400 Merge topic 'free-disallowed' c55fb044a9 cmBuildNameCommand: Implement as free function 86bf1eef75 cmState: Support free function disallowed commands Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3688 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98972371e4a768c36d4169431392fe727dcac2ee commit 98972371e4a768c36d4169431392fe727dcac2ee Merge: 01c7c42 9182b3c Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed Aug 21 10:41:45 2019 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Aug 21 10:41:45 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76b76a7f9bdf54c8dc299bd1a9c7bcc0bc9ef005 commit 76b76a7f9bdf54c8dc299bd1a9c7bcc0bc9ef005 Author: Hong Xu <h...@topbug.net> AuthorDate: Fri Aug 9 16:37:51 2019 -0700 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Aug 20 09:47:29 2019 -0400 FindCUDA: Fix support for backslashes in CUDA_NVCC_INCLUDE_DIRS Backslashes in `CUDA_NVCC_INCLUDE_DIRS` cause syntax errors because it is written to a generated `.cmake` script as a string literal. Use a bracket argument to hold the expanded value as we already do for `CUDA_NVCC_COMPILE_DEFINITIONS`. Then explicitly convert backslashes to forward slashes. diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index 6fc2439..af15d55 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -75,7 +75,8 @@ set(CUDA_NVCC_EXECUTABLE "@CUDA_NVCC_EXECUTABLE@") # path set(CUDA_NVCC_FLAGS @CUDA_NVCC_FLAGS@ ;; @CUDA_WRAP_OPTION_NVCC_FLAGS@) # list @CUDA_NVCC_FLAGS_CONFIG@ set(nvcc_flags @nvcc_flags@) # list -set(CUDA_NVCC_INCLUDE_DIRS "@CUDA_NVCC_INCLUDE_DIRS@") # list (needs to be in quotes to handle spaces properly). +set(CUDA_NVCC_INCLUDE_DIRS [==[@CUDA_NVCC_INCLUDE_DIRS@]==]) # list (needs to be in lua quotes to address backslashes) +string(REPLACE "\\" "/" CUDA_NVCC_INCLUDE_DIRS "${CUDA_NVCC_INCLUDE_DIRS}") set(CUDA_NVCC_COMPILE_DEFINITIONS [==[@CUDA_NVCC_COMPILE_DEFINITIONS@]==]) # list (needs to be in lua quotes see #16510 ). set(format_flag "@format_flag@") # string set(cuda_language_flag @cuda_language_flag@) # list https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c55fb044a9cf20a449f9d5ebc5d88c6de279786d commit c55fb044a9cf20a449f9d5ebc5d88c6de279786d Author: Regina Pfeifer <reg...@mailbox.org> AuthorDate: Tue Aug 13 13:43:47 2019 +0200 Commit: Regina Pfeifer <reg...@mailbox.org> CommitDate: Fri Aug 16 10:47:22 2019 +0200 cmBuildNameCommand: Implement as free function diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index ddff686..df94f1d 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -5,21 +5,20 @@ #include "cmsys/RegularExpression.hxx" #include <algorithm> +#include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmStateTypes.h" #include "cmSystemTools.h" -class cmExecutionStatus; - -// cmBuildNameCommand -bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args, - cmExecutionStatus&) +bool cmBuildNameCommand(std::vector<std::string> const& args, + cmExecutionStatus& status) { if (args.empty()) { - this->SetError("called with incorrect number of arguments"); + status.SetError("called with incorrect number of arguments"); return false; } - const char* cacheValue = this->Makefile->GetDefinition(args[0]); + cmMakefile& mf = status.GetMakefile(); + const char* cacheValue = mf.GetDefinition(args[0]); if (cacheValue) { // do we need to correct the value? cmsys::RegularExpression reg("[()/]"); @@ -28,14 +27,14 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args, std::replace(cv.begin(), cv.end(), '/', '_'); std::replace(cv.begin(), cv.end(), '(', '_'); std::replace(cv.begin(), cv.end(), ')', '_'); - this->Makefile->AddCacheDefinition(args[0], cv.c_str(), "Name of build.", - cmStateEnums::STRING); + mf.AddCacheDefinition(args[0], cv.c_str(), "Name of build.", + cmStateEnums::STRING); } return true; } std::string buildname = "WinNT"; - if (this->Makefile->GetDefinition("UNIX")) { + if (mf.GetDefinition("UNIX")) { buildname.clear(); cmSystemTools::RunSingleCommand("uname -a", &buildname, &buildname); if (!buildname.empty()) { @@ -47,14 +46,14 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args, } } std::string compiler = "${CMAKE_CXX_COMPILER}"; - this->Makefile->ExpandVariablesInString(compiler); + mf.ExpandVariablesInString(compiler); buildname += "-"; buildname += cmSystemTools::GetFilenameName(compiler); std::replace(buildname.begin(), buildname.end(), '/', '_'); std::replace(buildname.begin(), buildname.end(), '(', '_'); std::replace(buildname.begin(), buildname.end(), ')', '_'); - this->Makefile->AddCacheDefinition(args[0], buildname.c_str(), - "Name of build.", cmStateEnums::STRING); + mf.AddCacheDefinition(args[0], buildname.c_str(), "Name of build.", + cmStateEnums::STRING); return true; } diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index bd2d146..37a7268 100644 --- a/Source/cmBuildNameCommand.h +++ b/Source/cmBuildNameCommand.h @@ -8,21 +8,9 @@ #include <string> #include <vector> -#include "cm_memory.hxx" - -#include "cmCommand.h" - class cmExecutionStatus; -class cmBuildNameCommand : public cmCommand -{ -public: - std::unique_ptr<cmCommand> Clone() override - { - return cm::make_unique<cmBuildNameCommand>(); - } - bool InitialPass(std::vector<std::string> const& args, - cmExecutionStatus& status) override; -}; +bool cmBuildNameCommand(std::vector<std::string> const& args, + cmExecutionStatus& status); #endif diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index a9be445..1989427 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -221,7 +221,7 @@ void GetScriptingCommands(cmState* state) cm::make_unique<cmWriteFileCommand>()); state->AddDisallowedCommand( - "build_name", cm::make_unique<cmBuildNameCommand>(), cmPolicies::CMP0036, + "build_name", cmBuildNameCommand, cmPolicies::CMP0036, "The build_name command should not be called; see CMP0036."); state->AddDisallowedCommand( "use_mangled_mesa", cm::make_unique<cmUseMangledMesaCommand>(), diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 4f694e2..8cc960c 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -19,6 +19,7 @@ #include "cmGlobVerificationManager.h" #include "cmListFileCache.h" #include "cmMakefile.h" +#include "cmMessageType.h" #include "cmStatePrivate.h" #include "cmStateSnapshot.h" #include "cmStringAlgorithms.h" https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86bf1eef7587b837057f098927fb6e7e10149c66 commit 86bf1eef7587b837057f098927fb6e7e10149c66 Author: Regina Pfeifer <reg...@mailbox.org> AuthorDate: Tue Aug 13 13:42:59 2019 +0200 Commit: Regina Pfeifer <reg...@mailbox.org> CommitDate: Tue Aug 13 13:48:10 2019 +0200 cmState: Support free function disallowed commands diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 1ea72e1..4f694e2 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -432,6 +432,20 @@ void cmState::AddBuiltinCommand(std::string const& name, Command command) this->BuiltinCommands.emplace(name, std::move(command)); } +static bool InvokeBuiltinCommand(cmState::BuiltinCommand command, + std::vector<cmListFileArgument> const& args, + cmExecutionStatus& status) +{ + cmMakefile& mf = status.GetMakefile(); + std::vector<std::string> expandedArguments; + if (!mf.ExpandArguments(args, expandedArguments)) { + // There was an error expanding arguments. It was already + // reported, so we can skip this command without error. + return true; + } + return command(expandedArguments, status); +} + void cmState::AddBuiltinCommand(std::string const& name, BuiltinCommand command) { @@ -439,13 +453,34 @@ void cmState::AddBuiltinCommand(std::string const& name, name, [command](const std::vector<cmListFileArgument>& args, cmExecutionStatus& status) -> bool { - std::vector<std::string> expandedArguments; - if (!status.GetMakefile().ExpandArguments(args, expandedArguments)) { - // There was an error expanding arguments. It was already - // reported, so we can skip this command without error. - return true; + return InvokeBuiltinCommand(command, args, status); + }); +} + +void cmState::AddDisallowedCommand(std::string const& name, + BuiltinCommand command, + cmPolicies::PolicyID policy, + const char* message) +{ + this->AddBuiltinCommand( + name, + [command, policy, message](const std::vector<cmListFileArgument>& args, + cmExecutionStatus& status) -> bool { + cmMakefile& mf = status.GetMakefile(); + switch (mf.GetPolicyStatus(policy)) { + case cmPolicies::WARN: + mf.IssueMessage(MessageType::AUTHOR_WARNING, + cmPolicies::GetPolicyWarning(policy)); + break; + case cmPolicies::OLD: + break; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + mf.IssueMessage(MessageType::FATAL_ERROR, message); + return true; } - return command(expandedArguments, status); + return InvokeBuiltinCommand(command, args, status); }); } diff --git a/Source/cmState.h b/Source/cmState.h index 8847f3b..937ab61 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -157,6 +157,8 @@ public: std::unique_ptr<cmCommand> command); void AddBuiltinCommand(std::string const& name, Command command); void AddBuiltinCommand(std::string const& name, BuiltinCommand command); + void AddDisallowedCommand(std::string const& name, BuiltinCommand command, + cmPolicies::PolicyID policy, const char* message); void AddDisallowedCommand(std::string const& name, std::unique_ptr<cmCommand> command, cmPolicies::PolicyID policy, const char* message); ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA/run_nvcc.cmake | 3 ++- Source/cmBuildNameCommand.cxx | 25 +++++++++++---------- Source/cmBuildNameCommand.h | 16 ++------------ Source/cmCommands.cxx | 2 +- Source/cmState.cxx | 48 +++++++++++++++++++++++++++++++++++------ Source/cmState.h | 2 ++ 6 files changed, 61 insertions(+), 35 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits