[Cmake-commits] CMake branch, next, updated. v3.3.0-rc1-360-g6ad4ea7

Bill Hoffman bill.hoffman at kitware.com
Tue Jun 9 13:33:23 EDT 2015


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, next has been updated
       via  6ad4ea7baa433296f82133898e6eaf45bd6cd08f (commit)
       via  1e3b22f6d1379a14406a3a3a89c504a7bca2a863 (commit)
      from  c94dec14b30fcff16c91df0102ef96299e0ab147 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ad4ea7baa433296f82133898e6eaf45bd6cd08f
commit 6ad4ea7baa433296f82133898e6eaf45bd6cd08f
Merge: c94dec1 1e3b22f
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Tue Jun 9 13:33:22 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 9 13:33:22 2015 -0400

    Merge topic 'compiler-launcher' into next
    
    1e3b22f6 Change launcher to use cmake ; lists to specifiy the launcher command.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e3b22f6d1379a14406a3a3a89c504a7bca2a863
commit 1e3b22f6d1379a14406a3a3a89c504a7bca2a863
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Tue Jun 9 13:32:20 2015 -0400
Commit:     Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Tue Jun 9 13:32:20 2015 -0400

    Change launcher to use cmake ; lists to specifiy the launcher command.

diff --git a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
index 9a16687..3a59497 100644
--- a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
+++ b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
@@ -1,9 +1,9 @@
 <LANG>_COMPILER_LAUNCHER
----------------------------
+------------------------
 
 This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
 
-Specify a string containing a command line for a compiler launching tool.
+Specify a :ref:`;-list containing a command line for a compiler launching tool.
 The :ref:`Makefile Generators` and the :generator:`Ninja` generator will
 run this tool and pass the compiler and its arguments to the tool. Some
 example tools are distcc and ccache.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 6c630a5..f820b74 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -782,14 +782,16 @@ cmMakefileTargetGenerator
     const char *clauncher = this->Target->GetProperty(clauncher_prop);
     if (clauncher && *clauncher)
       {
-      // handle the case where launcher has its own arguments inside
-      // the variable handling spaces in the path, etc.
-      std::string cmd, args;
-      cmSystemTools::SplitProgramFromArgs(clauncher,
-                                          cmd, args);
+      std::vector<std::string> launcher_cmd;
+      cmSystemTools::ExpandListArgument(clauncher, launcher_cmd, true);
       std::string run_launcher =
-        this->LocalGenerator->EscapeForShell(cmd);
-      run_launcher += args;
+        this->LocalGenerator->EscapeForShell(launcher_cmd[0]);
+      // now put any arguments in if they exist
+      for(size_t i =1; i < launcher_cmd.size(); ++i)
+        {
+        run_launcher += " ";
+        run_launcher += launcher_cmd[i];
+        }
       run_launcher += " ";
       compileCommands.front().insert(0, run_launcher);
       }
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 3e3c9cd..095e1f7 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -482,14 +482,16 @@ cmNinjaTargetGenerator
     const char *clauncher = this->Target->GetProperty(clauncher_prop);
     if (clauncher && *clauncher)
       {
-      // handle the case where launcher has its own arguments inside
-      // the variable handling spaces in the path, etc.
-      std::string cmd, args;
-      cmSystemTools::SplitProgramFromArgs(clauncher,
-                                          cmd, args);
+      std::vector<std::string> launcher_cmd;
+      cmSystemTools::ExpandListArgument(clauncher, launcher_cmd, true);
       std::string run_launcher =
-        this->LocalGenerator->EscapeForShell(cmd);
-      run_launcher += args;
+        this->LocalGenerator->EscapeForShell(launcher_cmd[0]);
+      // now put any arguments in if they exist
+      for(size_t i =1; i < launcher_cmd.size(); ++i)
+        {
+        run_launcher += " ";
+        run_launcher += launcher_cmd[i];
+        }
       run_launcher += " ";
       compileCmds.front().insert(0, run_launcher);
       }
@@ -507,7 +509,6 @@ cmNinjaTargetGenerator
   std::string cmdLine =
     this->GetLocalGenerator()->BuildCommandLine(compileCmds);
 
-
   // Write the rule for compiling file of the given language.
   std::ostringstream comment;
   comment << "Rule for compiling " << lang << " files.";
diff --git a/Tests/RunCMake/CompilerLauncher/C.cmake b/Tests/RunCMake/CompilerLauncher/C.cmake
index 7bf2b57..67bf7c4 100644
--- a/Tests/RunCMake/CompilerLauncher/C.cmake
+++ b/Tests/RunCMake/CompilerLauncher/C.cmake
@@ -1,4 +1,4 @@
 enable_language(C)
-set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_COMMAND} -E env USED_LAUNCHER=1")
+set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
 set(CMAKE_VERBOSE_MAKEFILE TRUE)
 add_executable(main main.c)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX.cmake b/Tests/RunCMake/CompilerLauncher/CXX.cmake
index 66e75c9..cdd3478 100644
--- a/Tests/RunCMake/CompilerLauncher/CXX.cmake
+++ b/Tests/RunCMake/CompilerLauncher/CXX.cmake
@@ -1,4 +1,4 @@
 enable_language(CXX)
-set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_COMMAND} -E env USED_LAUNCHER=1")
+set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
 set(CMAKE_VERBOSE_MAKEFILE TRUE)
 add_executable(main main.cxx)

-----------------------------------------------------------------------

Summary of changes:
 Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst  |    4 ++--
 Source/cmMakefileTargetGenerator.cxx      |   16 +++++++++-------
 Source/cmNinjaTargetGenerator.cxx         |   17 +++++++++--------
 Tests/RunCMake/CompilerLauncher/C.cmake   |    2 +-
 Tests/RunCMake/CompilerLauncher/CXX.cmake |    2 +-
 5 files changed, 22 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list