[Cmake-commits] CMake branch, master, updated. v3.11.0-rc1-57-ga8d182f
Kitware Robot
kwrobot at kitware.com
Tue Feb 20 11:55:05 EST 2018
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 a8d182fbbfc40b34c4ea11b1d6bf787f5fcf7386 (commit)
via cab9af7e9754a0a0aa718e3e467152c1524e805c (commit)
via 846a4dd1185e990da0948f97e245e704a1d68c93 (commit)
via 8a99ccc5ed2ce7204b29126f884121bdc39b7bbe (commit)
via 10f39ca7f7c9b2396101d4ebd7b5933276017b85 (commit)
via 689eeb67cb87a9ed1d91a4971806488d00e68f42 (commit)
via a1dee224b8f92a16a84ac285620136d04adb880a (commit)
via ed000d7d30434c8cc0be50c8aa19d7ee12e2101b (commit)
from 3bc3762c7c54ba0280413b3782473e078e1b00c8 (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=a8d182fbbfc40b34c4ea11b1d6bf787f5fcf7386
commit a8d182fbbfc40b34c4ea11b1d6bf787f5fcf7386
Merge: 846a4dd cab9af7
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 20 16:54:10 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Feb 20 11:54:15 2018 -0500
Merge topic 'ti-depfile-flag-fix'
cab9af7e Compiler/TI: Fix depfile generation for C++
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1774
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cab9af7e9754a0a0aa718e3e467152c1524e805c
commit cab9af7e9754a0a0aa718e3e467152c1524e805c
Author: Grzegorz Dobinski <snibod at protonmail.com>
AuthorDate: Fri Feb 16 17:07:26 2018 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 20 11:52:11 2018 -0500
Compiler/TI: Fix depfile generation for C++
In commit v3.11.0-rc1~466^2 (Compiler/TI: Add support for depfile
generation for Ninja, 2017-10-16) the flag for C++ was added in a
variable with a typo in its name. Fix the spelling.
Issue: #17360
diff --git a/Modules/Compiler/TI-CXX.cmake b/Modules/Compiler/TI-CXX.cmake
index 8b0069b..4c6af06 100644
--- a/Modules/Compiler/TI-CXX.cmake
+++ b/Modules/Compiler/TI-CXX.cmake
@@ -2,7 +2,7 @@ set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
set(CMAKE_LINK_LIBRARY_FLAG "--library=")
set(CMAKE_INCLUDE_FLAG_CXX "--include_path=")
-set(CMAKE_DEPFILE_FLAGS_CCX "--preproc_with_compile --preproc_dependency=<DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_CXX "--preproc_with_compile --preproc_dependency=<DEPFILE>")
set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> --compile_only --skip_assembler --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> --preproc_only --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=846a4dd1185e990da0948f97e245e704a1d68c93
commit 846a4dd1185e990da0948f97e245e704a1d68c93
Merge: 8a99ccc 689eeb6
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 20 16:47:43 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Feb 20 11:47:51 2018 -0500
Merge topic 'string-join'
689eeb67 string: Add JOIN subcommand
Acked-by: Kitware Robot <kwrobot at kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate at gmail.com>
Merge-request: !1762
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a99ccc5ed2ce7204b29126f884121bdc39b7bbe
commit 8a99ccc5ed2ce7204b29126f884121bdc39b7bbe
Merge: 10f39ca ed000d7
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 20 16:46:16 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Feb 20 11:46:21 2018 -0500
Merge topic 'ninja-cmake-deps'
ed000d7d Ninja: Don't add custom command outputs to phony rule for CMake inputs
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1768
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=10f39ca7f7c9b2396101d4ebd7b5933276017b85
commit 10f39ca7f7c9b2396101d4ebd7b5933276017b85
Merge: 3bc3762 a1dee22
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 20 16:44:51 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Feb 20 11:44:59 2018 -0500
Merge topic 'msvc-parallel-build-17696'
a1dee224 CMake: Enable /MP for MSVC toolchain
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1718
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=689eeb67cb87a9ed1d91a4971806488d00e68f42
commit 689eeb67cb87a9ed1d91a4971806488d00e68f42
Author: Alex Turbov <i.zaufi at gmail.com>
AuthorDate: Sun Feb 11 21:20:57 2018 +0800
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Feb 16 10:04:47 2018 -0500
string: Add JOIN subcommand
This is just like CONCAT but accepts a glue string to put between
each value. `JOIN ""` is equivalent to `CONCAT`.
diff --git a/Help/command/string.rst b/Help/command/string.rst
index fb3893f..709559d 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -151,6 +151,16 @@ CONCAT
Concatenate all the input arguments together and store
the result in the named output variable.
+JOIN
+""""
+
+::
+
+ string(JOIN <glue> <output variable> [<input>...])
+
+Join all the input arguments together using the glue
+string and store the result in the named output variable.
+
TOLOWER
"""""""
diff --git a/Help/release/dev/string-join.rst b/Help/release/dev/string-join.rst
new file mode 100644
index 0000000..5cca711
--- /dev/null
+++ b/Help/release/dev/string-join.rst
@@ -0,0 +1,5 @@
+string-join
+-----------
+
+* The :command:`string` command learned a ``JOIN`` sub-command
+ to concatenate input strings separated by a glue string.
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 55af078..9631912 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -68,6 +68,9 @@ bool cmStringCommand::InitialPass(std::vector<std::string> const& args,
if (subCommand == "CONCAT") {
return this->HandleConcatCommand(args);
}
+ if (subCommand == "JOIN") {
+ return this->HandleJoinCommand(args);
+ }
if (subCommand == "SUBSTRING") {
return this->HandleSubstringCommand(args);
}
@@ -677,8 +680,26 @@ bool cmStringCommand::HandleConcatCommand(std::vector<std::string> const& args)
return false;
}
- std::string const& variableName = args[1];
- std::string value = cmJoin(cmMakeRange(args).advance(2), std::string());
+ return this->joinImpl(args, std::string(), 1);
+}
+
+bool cmStringCommand::HandleJoinCommand(std::vector<std::string> const& args)
+{
+ if (args.size() < 3) {
+ this->SetError("sub-command JOIN requires at least two arguments.");
+ return false;
+ }
+
+ return this->joinImpl(args, args[1], 2);
+}
+
+bool cmStringCommand::joinImpl(std::vector<std::string> const& args,
+ std::string const& glue, const size_t varIdx)
+{
+ std::string const& variableName = args[varIdx];
+ // NOTE Items to concat/join placed right after the variable for
+ // both `CONCAT` and `JOIN` sub-commands.
+ std::string value = cmJoin(cmMakeRange(args).advance(varIdx + 1), glue);
this->Makefile->AddDefinition(variableName, value.c_str());
return true;
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index b287e37..569ed83 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <cstddef>
#include <string>
#include <vector>
@@ -48,6 +49,7 @@ protected:
bool HandleAppendCommand(std::vector<std::string> const& args);
bool HandlePrependCommand(std::vector<std::string> const& args);
bool HandleConcatCommand(std::vector<std::string> const& args);
+ bool HandleJoinCommand(std::vector<std::string> const& args);
bool HandleStripCommand(std::vector<std::string> const& args);
bool HandleRandomCommand(std::vector<std::string> const& args);
bool HandleFindCommand(std::vector<std::string> const& args);
@@ -56,6 +58,9 @@ protected:
bool HandleGenexStripCommand(std::vector<std::string> const& args);
bool HandleUuidCommand(std::vector<std::string> const& args);
+ bool joinImpl(std::vector<std::string> const& args, std::string const& glue,
+ size_t varIdx);
+
class RegexReplacement
{
public:
diff --git a/Tests/RunCMake/string/Join.cmake b/Tests/RunCMake/string/Join.cmake
new file mode 100644
index 0000000..081f1e4
--- /dev/null
+++ b/Tests/RunCMake/string/Join.cmake
@@ -0,0 +1,16 @@
+string(JOIN % out)
+if(NOT out STREQUAL "")
+ message(FATAL_ERROR "\"string(JOIN % out)\" set out to \"${out}\"")
+endif()
+string(JOIN % out a)
+if(NOT out STREQUAL "a")
+ message(FATAL_ERROR "\"string(JOIN % out a)\" set out to \"${out}\"")
+endif()
+string(JOIN % out a "b")
+if(NOT out STREQUAL "a%b")
+ message(FATAL_ERROR "\"string(JOIN % out a \"b\")\" set out to \"${out}\"")
+endif()
+string(JOIN :: out a "b")
+if(NOT out STREQUAL "a::b")
+ message(FATAL_ERROR "\"string(JOIN :: out a \"b\")\" set out to \"${out}\"")
+endif()
diff --git a/Tests/RunCMake/string/JoinNoArgs-result.txt b/Tests/RunCMake/string/JoinNoArgs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/string/JoinNoArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/string/JoinNoArgs-stderr.txt b/Tests/RunCMake/string/JoinNoArgs-stderr.txt
new file mode 100644
index 0000000..d9dcec3
--- /dev/null
+++ b/Tests/RunCMake/string/JoinNoArgs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at JoinNoArgs.cmake:1 \(string\):
+ string sub-command JOIN requires at least two arguments.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/string/JoinNoArgs.cmake b/Tests/RunCMake/string/JoinNoArgs.cmake
new file mode 100644
index 0000000..35ba4d9
--- /dev/null
+++ b/Tests/RunCMake/string/JoinNoArgs.cmake
@@ -0,0 +1 @@
+string(JOIN)
diff --git a/Tests/RunCMake/string/JoinNoVar-result.txt b/Tests/RunCMake/string/JoinNoVar-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/string/JoinNoVar-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/string/JoinNoVar-stderr.txt b/Tests/RunCMake/string/JoinNoVar-stderr.txt
new file mode 100644
index 0000000..90701a9
--- /dev/null
+++ b/Tests/RunCMake/string/JoinNoVar-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at JoinNoVar.cmake:1 \(string\):
+ string sub-command JOIN requires at least two arguments.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/string/JoinNoVar.cmake b/Tests/RunCMake/string/JoinNoVar.cmake
new file mode 100644
index 0000000..35f7b92
--- /dev/null
+++ b/Tests/RunCMake/string/JoinNoVar.cmake
@@ -0,0 +1 @@
+string(JOIN ";")
diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake
index 513d1e3..211337a 100644
--- a/Tests/RunCMake/string/RunCMakeTest.cmake
+++ b/Tests/RunCMake/string/RunCMakeTest.cmake
@@ -9,6 +9,10 @@ run_cmake(PrependNoArgs)
run_cmake(Concat)
run_cmake(ConcatNoArgs)
+run_cmake(Join)
+run_cmake(JoinNoArgs)
+run_cmake(JoinNoVar)
+
run_cmake(Timestamp)
run_cmake(TimestampEmpty)
run_cmake(TimestampInvalid)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1dee224b8f92a16a84ac285620136d04adb880a
commit a1dee224b8f92a16a84ac285620136d04adb880a
Author: Robert Dailey <rcdailey at gmail.com>
AuthorDate: Mon Jan 29 11:34:28 2018 -0600
Commit: Robert Dailey <rcdailey at gmail.com>
CommitDate: Thu Feb 15 10:45:37 2018 -0600
CMake: Enable /MP for MSVC toolchain
A new cache option named `CMake_MSVC_PARALLEL` is now available that can
be used to control the usage of [`/MP`][1] to the MSVC compiler. This
enables parallelized builds on a per-translation unit basis. To enable
`/MP`, specify value `ON` to the option. Using an integral non-zero
value will control the specific number of threads used with the `/MP`
option, as opposed to letting the toolchain decide for you.
Fixes #17696
[1]: https://docs.microsoft.com/en-us/cpp/build/reference/mp-build-with-multiple-processes
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 32e7005..ec9b31b 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -82,3 +82,26 @@ endif ()
if (CMAKE_ANSI_CFLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
endif ()
+
+# Allow per-translation-unit parallel builds when using MSVC
+if(CMAKE_GENERATOR MATCHES "Visual Studio" AND
+ (CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel" OR
+ CMAKE_CXX_COMPILER_ID MATCHES "MSVC|Intel"))
+
+ set(CMake_MSVC_PARALLEL ON CACHE STRING "\
+Enables /MP flag for parallel builds using MSVC. Specify an \
+integer value to control the number of threads used (Only \
+works on some older versions of Visual Studio). Setting to \
+ON lets the toolchain decide how many threads to use. Set to \
+OFF to disable /MP completely." )
+
+ if(CMake_MSVC_PARALLEL)
+ if(CMake_MSVC_PARALLEL GREATER 0)
+ string(APPEND CMAKE_C_FLAGS " /MP${CMake_MSVC_PARALLEL}")
+ string(APPEND CMAKE_CXX_FLAGS " /MP${CMake_MSVC_PARALLEL}")
+ else()
+ string(APPEND CMAKE_C_FLAGS " /MP")
+ string(APPEND CMAKE_CXX_FLAGS " /MP")
+ endif()
+ endif()
+endif()
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed000d7d30434c8cc0be50c8aa19d7ee12e2101b
commit ed000d7d30434c8cc0be50c8aa19d7ee12e2101b
Author: Patrick Stewart <patstew at gmail.com>
AuthorDate: Thu Feb 15 14:30:34 2018 +0000
Commit: Patrick Stewart <patstew at gmail.com>
CommitDate: Thu Feb 15 15:03:53 2018 +0000
Ninja: Don't add custom command outputs to phony rule for CMake inputs
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index b251f86..8410609 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1384,8 +1384,14 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
/*explicitDeps=*/cmNinjaDeps(), implicitDeps,
/*orderOnlyDeps=*/cmNinjaDeps(), variables);
+ cmNinjaDeps missingInputs;
+ std::set_difference(std::make_move_iterator(implicitDeps.begin()),
+ std::make_move_iterator(implicitDeps.end()),
+ CustomCommandOutputs.begin(), CustomCommandOutputs.end(),
+ std::back_inserter(missingInputs));
+
this->WritePhonyBuild(os, "A missing CMake input file is not an error.",
- implicitDeps, cmNinjaDeps());
+ missingInputs, cmNinjaDeps());
}
std::string cmGlobalNinjaGenerator::ninjaCmd() const
-----------------------------------------------------------------------
Summary of changes:
CompileFlags.cmake | 23 ++++++++++++++++++
Help/command/string.rst | 10 ++++++++
Help/release/dev/string-join.rst | 5 ++++
Modules/Compiler/TI-CXX.cmake | 2 +-
Source/cmGlobalNinjaGenerator.cxx | 8 ++++++-
Source/cmStringCommand.cxx | 25 ++++++++++++++++++--
Source/cmStringCommand.h | 5 ++++
Tests/RunCMake/string/Join.cmake | 16 +++++++++++++
.../JoinNoArgs-result.txt} | 0
Tests/RunCMake/string/JoinNoArgs-stderr.txt | 4 ++++
Tests/RunCMake/string/JoinNoArgs.cmake | 1 +
.../JoinNoVar-result.txt} | 0
Tests/RunCMake/string/JoinNoVar-stderr.txt | 4 ++++
Tests/RunCMake/string/JoinNoVar.cmake | 1 +
Tests/RunCMake/string/RunCMakeTest.cmake | 4 ++++
15 files changed, 104 insertions(+), 4 deletions(-)
create mode 100644 Help/release/dev/string-join.rst
create mode 100644 Tests/RunCMake/string/Join.cmake
copy Tests/RunCMake/{Android/BadSYSROOT-result.txt => string/JoinNoArgs-result.txt} (100%)
create mode 100644 Tests/RunCMake/string/JoinNoArgs-stderr.txt
create mode 100644 Tests/RunCMake/string/JoinNoArgs.cmake
copy Tests/RunCMake/{Android/BadSYSROOT-result.txt => string/JoinNoVar-result.txt} (100%)
create mode 100644 Tests/RunCMake/string/JoinNoVar-stderr.txt
create mode 100644 Tests/RunCMake/string/JoinNoVar.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list