[Cmake-commits] CMake branch, master, updated. v3.11.0-rc2-111-g82de050

Kitware Robot kwrobot at kitware.com
Wed Feb 28 08:25:04 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  82de05088f762371c6cd753ae19533dc9f5cd6b2 (commit)
       via  74dac86c7625b1c33ccc564155a7f8982f1ce67f (commit)
       via  514e845f4eea3322d13836c2e83ea9999fb79987 (commit)
       via  eaf9f69d41961353bf0fc9d63c543f957692d714 (commit)
       via  596a7f262aa9dd505e4b8f3c3da22e265e38b0ed (commit)
       via  8182ebca32a42c157697d6afdc07678afed1443d (commit)
      from  cc87b1f0d7c0c20baec921b75c5662553bfdbff0 (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=82de05088f762371c6cd753ae19533dc9f5cd6b2
commit 82de05088f762371c6cd753ae19533dc9f5cd6b2
Merge: 74dac86 eaf9f69
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 28 13:16:52 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Feb 28 08:17:33 2018 -0500

    Merge topic 'co-compile-with-launcher'
    
    eaf9f69d41 Fix combined use of compiler launcher with lint tools
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1791


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74dac86c7625b1c33ccc564155a7f8982f1ce67f
commit 74dac86c7625b1c33ccc564155a7f8982f1ce67f
Merge: 514e845 596a7f2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 28 13:16:22 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Feb 28 08:16:52 2018 -0500

    Merge topic 'findjava-jar-in-dev-component'
    
    596a7f262a FindJava: Add Java_JAR_EXECUTABLE to a component: Development
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1807


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=514e845f4eea3322d13836c2e83ea9999fb79987
commit 514e845f4eea3322d13836c2e83ea9999fb79987
Merge: cc87b1f 8182ebc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 28 13:16:05 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Feb 28 08:16:14 2018 -0500

    Merge topic 'ideoptions-string'
    
    8182ebca32 cmIDEOptions: use std::string
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1804


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eaf9f69d41961353bf0fc9d63c543f957692d714
commit eaf9f69d41961353bf0fc9d63c543f957692d714
Author:     Ilya A. Kriveshko <ilya at veobot.com>
AuthorDate: Thu Feb 22 08:01:07 2018 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 27 13:07:04 2018 -0500

    Fix combined use of compiler launcher with lint tools
    
    When using ccache with clang-tidy, ccache needs to wrap compiler
    invocation, rather than cmake invocation.  But it needs to do it without
    affecting the command line that iwyu-like tools are receiving.
    
    With this fix, if __run_co_compile is used, compile launcher is passed
    using the new --launcher option, but if __run_co_compile is not needed,
    compiler launcher is prepended to the command line as before.
    
    To better illustrate the change: with this fix if running clang-tidy
    with CXX_COMPILER_LAUNCHER set to "/usr/bin/time;-p;ccache" (time -p
    added strictly for illustration purposes), the command line changes
    from:
    
        /usr/bin/time -p ccache cmake -E __run_co_compile \
            --tidy=clang-tidy ... -- g++ ...
    
    to:
    
        cmake -E __run_co_compile \
            --launcher="/usr/bin/time;-p;ccache" \
            --tidy=clang-tidy ... -- g++ ...
    
    This allows the compiler to be run via the launcher, but leaves tidy
    (& friends) invocations unaffected.
    
    Fixes: #16493

diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 73cf1f0..abe5ff3 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -643,6 +643,18 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
         source.GetFullPath(), workingDirectory, compileCommand);
     }
 
+    // See if we need to use a compiler launcher like ccache or distcc
+    std::string compilerLauncher;
+    if (!compileCommands.empty() && (lang == "C" || lang == "CXX" ||
+                                     lang == "Fortran" || lang == "CUDA")) {
+      std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
+      const char* clauncher =
+        this->GeneratorTarget->GetProperty(clauncher_prop);
+      if (clauncher && *clauncher) {
+        compilerLauncher = clauncher;
+      }
+    }
+
     // Maybe insert an include-what-you-use runner.
     if (!compileCommands.empty() && (lang == "C" || lang == "CXX")) {
       std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
@@ -656,6 +668,13 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
       if ((iwyu && *iwyu) || (tidy && *tidy) || (cpplint && *cpplint) ||
           (cppcheck && *cppcheck)) {
         std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_co_compile";
+        if (!compilerLauncher.empty()) {
+          // In __run_co_compile case the launcher command is supplied
+          // via --launcher=<maybe-list> and consumed
+          run_iwyu += " --launcher=";
+          run_iwyu += this->LocalGenerator->EscapeForShell(compilerLauncher);
+          compilerLauncher.clear();
+        }
         if (iwyu && *iwyu) {
           run_iwyu += " --iwyu=";
           run_iwyu += this->LocalGenerator->EscapeForShell(iwyu);
@@ -682,21 +701,15 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
       }
     }
 
-    // Maybe insert a compiler launcher like ccache or distcc
-    if (!compileCommands.empty() && (lang == "C" || lang == "CXX" ||
-                                     lang == "Fortran" || lang == "CUDA")) {
-      std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
-      const char* clauncher =
-        this->GeneratorTarget->GetProperty(clauncher_prop);
-      if (clauncher && *clauncher) {
-        std::vector<std::string> launcher_cmd;
-        cmSystemTools::ExpandListArgument(clauncher, launcher_cmd, true);
-        for (std::string& i : launcher_cmd) {
-          i = this->LocalGenerator->EscapeForShell(i);
-        }
-        std::string const& run_launcher = cmJoin(launcher_cmd, " ") + " ";
-        compileCommands.front().insert(0, run_launcher);
+    // If compiler launcher was specified and not consumed above, it
+    // goes to the beginning of the command line.
+    if (!compileCommands.empty() && !compilerLauncher.empty()) {
+      std::vector<std::string> args;
+      cmSystemTools::ExpandListArgument(compilerLauncher, args, true);
+      for (std::string& i : args) {
+        i = this->LocalGenerator->EscapeForShell(i);
       }
+      compileCommands.front().insert(0, cmJoin(args, " ") + " ");
     }
 
     std::string launcher;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index f4faf47..60c5a65 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -653,6 +653,17 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
   }
 
+  // See if we need to use a compiler launcher like ccache or distcc
+  std::string compilerLauncher;
+  if (!compileCmds.empty() &&
+      (lang == "C" || lang == "CXX" || lang == "Fortran" || lang == "CUDA")) {
+    std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
+    const char* clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
+    if (clauncher && *clauncher) {
+      compilerLauncher = clauncher;
+    }
+  }
+
   // Maybe insert an include-what-you-use runner.
   if (!compileCmds.empty() && (lang == "C" || lang == "CXX")) {
     std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
@@ -668,6 +679,13 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
       std::string run_iwyu = this->GetLocalGenerator()->ConvertToOutputFormat(
         cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL);
       run_iwyu += " -E __run_co_compile";
+      if (!compilerLauncher.empty()) {
+        // In __run_co_compile case the launcher command is supplied
+        // via --launcher=<maybe-list> and consumed
+        run_iwyu += " --launcher=";
+        run_iwyu += this->LocalGenerator->EscapeForShell(compilerLauncher);
+        compilerLauncher.clear();
+      }
       if (iwyu && *iwyu) {
         run_iwyu += " --iwyu=";
         run_iwyu += this->GetLocalGenerator()->EscapeForShell(iwyu);
@@ -693,20 +711,15 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     }
   }
 
-  // Maybe insert a compiler launcher like ccache or distcc
-  if (!compileCmds.empty() &&
-      (lang == "C" || lang == "CXX" || lang == "Fortran" || lang == "CUDA")) {
-    std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
-    const char* clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
-    if (clauncher && *clauncher) {
-      std::vector<std::string> launcher_cmd;
-      cmSystemTools::ExpandListArgument(clauncher, launcher_cmd, true);
-      for (std::string& i : launcher_cmd) {
-        i = this->LocalGenerator->EscapeForShell(i);
-      }
-      std::string const& run_launcher = cmJoin(launcher_cmd, " ") + " ";
-      compileCmds.front().insert(0, run_launcher);
+  // If compiler launcher was specified and not consumed above, it
+  // goes to the beginning of the command line.
+  if (!compileCmds.empty() && !compilerLauncher.empty()) {
+    std::vector<std::string> args;
+    cmSystemTools::ExpandListArgument(compilerLauncher, args, true);
+    for (std::string& i : args) {
+      i = this->LocalGenerator->EscapeForShell(i);
     }
+    compileCmds.front().insert(0, cmJoin(args, " ") + " ");
   }
 
   if (!compileCmds.empty()) {
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index e7d92d4..6f3a90f 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -359,7 +359,8 @@ struct CoCompileJob
 int cmcmd::HandleCoCompileCommands(std::vector<std::string>& args)
 {
   std::vector<CoCompileJob> jobs;
-  std::string sourceFile; // store --source=
+  std::string sourceFile;             // store --source=
+  std::vector<std::string> launchers; // store --launcher=
 
   // Default is to run the original command found after -- if the option
   // does not need to do that, it should be specified here, currently only
@@ -390,15 +391,17 @@ int cmcmd::HandleCoCompileCommands(std::vector<std::string>& args)
           }
         }
       }
-      if (cmHasLiteralPrefix(arg, "--source=")) {
-        sourceFile = arg.substr(9);
-        optionFound = true;
-      }
-      // if it was not a co-compiler or --source then error
       if (!optionFound) {
-        std::cerr << "__run_co_compile given unknown argument: " << arg
-                  << "\n";
-        return 1;
+        if (cmHasLiteralPrefix(arg, "--source=")) {
+          sourceFile = arg.substr(9);
+        } else if (cmHasLiteralPrefix(arg, "--launcher=")) {
+          cmSystemTools::ExpandListArgument(arg.substr(11), launchers, true);
+        } else {
+          // if it was not a co-compiler or --source/--launcher then error
+          std::cerr << "__run_co_compile given unknown argument: " << arg
+                    << "\n";
+          return 1;
+        }
       }
     } else { // if not doing_options then push to orig_cmd
       orig_cmd.push_back(arg);
@@ -436,6 +439,11 @@ int cmcmd::HandleCoCompileCommands(std::vector<std::string>& args)
     return 0;
   }
 
+  // Prepend launcher argument(s), if any
+  if (!launchers.empty()) {
+    orig_cmd.insert(orig_cmd.begin(), launchers.begin(), launchers.end());
+  }
+
   // Now run the real compiler command and return its result value
   int ret;
   if (!cmSystemTools::RunSingleCommand(orig_cmd, nullptr, nullptr, &ret,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=596a7f262aa9dd505e4b8f3c3da22e265e38b0ed
commit 596a7f262aa9dd505e4b8f3c3da22e265e38b0ed
Author:     Giel van Schijndel <giel at mortis.eu>
AuthorDate: Tue Feb 27 15:11:49 2018 +0100
Commit:     Giel van Schijndel <giel at mortis.eu>
CommitDate: Tue Feb 27 17:32:09 2018 +0100

    FindJava: Add Java_JAR_EXECUTABLE to a component: Development
    
    All discovered executables were placed in a component, except for 'jar'.
    This forced the use of find_package(Java) without any component
    specification.  This commit adds 'jar' to the 'Development' component,
    because that's what it's used for.

diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index e3f5af6..c56c197 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -18,7 +18,7 @@
 # ::
 #
 #   Runtime     = User just want to execute some Java byte-compiled
-#   Development = Development tools (java, javac, javah and javadoc), includes Runtime component
+#   Development = Development tools (java, javac, javah, jar and javadoc), includes Runtime component
 #   IdlJ        = idl compiler for Java
 #   JarSigner   = signer tool for jar
 #
@@ -237,16 +237,16 @@ if(Java_FIND_COMPONENTS)
       endif()
     elseif(component STREQUAL "Development")
       list(APPEND _JAVA_REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAVAC_EXECUTABLE
-                                      Java_JAVADOC_EXECUTABLE)
+                                      Java_JAR_EXECUTABLE Java_JAVADOC_EXECUTABLE)
       if(Java_VERSION VERSION_LESS "1.10")
         list(APPEND _JAVA_REQUIRED_VARS Java_JAVAH_EXECUTABLE)
         if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE
-            AND Java_JAVAH_EXECUTABLE AND Java_JAVADOC_EXECUTABLE)
+            AND Java_JAVAH_EXECUTABLE AND Java_JAR_EXECUTABLE AND Java_JAVADOC_EXECUTABLE)
           set(Java_Development_FOUND TRUE)
         endif()
       else()
         if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE
-            AND Java_JAVADOC_EXECUTABLE)
+            AND Java_JAR_EXECUTABLE AND Java_JAVADOC_EXECUTABLE)
           set(Java_Development_FOUND TRUE)
         endif()
       endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8182ebca32a42c157697d6afdc07678afed1443d
commit 8182ebca32a42c157697d6afdc07678afed1443d
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Mon Feb 26 11:24:45 2018 -0500
Commit:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
CommitDate: Mon Feb 26 11:24:45 2018 -0500

    cmIDEOptions: use std::string

diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index 354b757..f996788 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -25,7 +25,7 @@ cmIDEOptions::~cmIDEOptions()
 {
 }
 
-void cmIDEOptions::HandleFlag(const char* flag)
+void cmIDEOptions::HandleFlag(std::string const& flag)
 {
   // If the last option was -D then this option is the definition.
   if (this->DoingDefine) {
@@ -49,26 +49,27 @@ void cmIDEOptions::HandleFlag(const char* flag)
   }
 
   // Look for known arguments.
-  if (flag[0] == '-' || (this->AllowSlash && flag[0] == '/')) {
+  size_t len = flag.length();
+  if (len > 0 && (flag[0] == '-' || (this->AllowSlash && flag[0] == '/'))) {
     // Look for preprocessor definitions.
-    if (this->AllowDefine && flag[1] == 'D') {
-      if (flag[2] == '\0') {
+    if (this->AllowDefine && len > 1 && flag[1] == 'D') {
+      if (len <= 2) {
         // The next argument will have the definition.
         this->DoingDefine = true;
       } else {
         // Store this definition.
-        this->Defines.push_back(flag + 2);
+        this->Defines.push_back(flag.substr(2));
       }
       return;
     }
     // Look for include directory.
-    if (this->AllowInclude && flag[1] == 'I') {
-      if (flag[2] == '\0') {
+    if (this->AllowInclude && len > 1 && flag[1] == 'I') {
+      if (len <= 2) {
         // The next argument will have the include directory.
         this->DoingInclude = true;
       } else {
         // Store this include directory.
-        this->Includes.push_back(flag + 2);
+        this->Includes.push_back(flag.substr(2));
       }
       return;
     }
@@ -92,8 +93,9 @@ void cmIDEOptions::HandleFlag(const char* flag)
 }
 
 bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
-                                  const char* flag, bool& flag_handled)
+                                  std::string const& flag, bool& flag_handled)
 {
+  const char* pf = flag.c_str() + 1;
   // Look for an entry in the flag table matching this flag.
   for (cmIDEFlagTable const* entry = table; entry->IDEName; ++entry) {
     bool entry_found = false;
@@ -102,17 +104,17 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
       // the entry specifies UserRequired we must match only if a
       // non-empty value is given.
       int n = static_cast<int>(strlen(entry->commandFlag));
-      if ((strncmp(flag + 1, entry->commandFlag, n) == 0 ||
+      if ((strncmp(pf, entry->commandFlag, n) == 0 ||
            (entry->special & cmIDEFlagTable::CaseInsensitive &&
-            cmsysString_strncasecmp(flag + 1, entry->commandFlag, n))) &&
+            cmsysString_strncasecmp(pf, entry->commandFlag, n))) &&
           (!(entry->special & cmIDEFlagTable::UserRequired) ||
-           static_cast<int>(strlen(flag + 1)) > n)) {
-        this->FlagMapUpdate(entry, flag + n + 1);
+           static_cast<int>(strlen(pf)) > n)) {
+        this->FlagMapUpdate(entry, std::string(pf + n));
         entry_found = true;
       }
-    } else if (strcmp(flag + 1, entry->commandFlag) == 0 ||
+    } else if (strcmp(pf, entry->commandFlag) == 0 ||
                (entry->special & cmIDEFlagTable::CaseInsensitive &&
-                cmsysString_strcasecmp(flag + 1, entry->commandFlag) == 0)) {
+                cmsysString_strcasecmp(pf, entry->commandFlag) == 0)) {
       if (entry->special & cmIDEFlagTable::UserFollowing) {
         // This flag expects a value in the following argument.
         this->DoingFollowing = entry;
@@ -137,7 +139,7 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
 }
 
 void cmIDEOptions::FlagMapUpdate(cmIDEFlagTable const* entry,
-                                 const char* new_value)
+                                 std::string const& new_value)
 {
   if (entry->special & cmIDEFlagTable::UserIgnored) {
     // Ignore the user-specified value.
@@ -157,9 +159,9 @@ void cmIDEOptions::AddDefine(const std::string& def)
   this->Defines.push_back(def);
 }
 
-void cmIDEOptions::AddDefines(const char* defines)
+void cmIDEOptions::AddDefines(std::string const& defines)
 {
-  if (defines) {
+  if (!defines.empty()) {
     // Expand the list of definitions.
     cmSystemTools::ExpandListArgument(defines, this->Defines);
   }
@@ -179,9 +181,9 @@ void cmIDEOptions::AddInclude(const std::string& include)
   this->Includes.push_back(include);
 }
 
-void cmIDEOptions::AddIncludes(const char* includes)
+void cmIDEOptions::AddIncludes(std::string const& includes)
 {
-  if (includes) {
+  if (!includes.empty()) {
     // Expand the list of includes.
     cmSystemTools::ExpandListArgument(includes, this->Includes);
   }
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index 54cb524..a4e5757 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -22,12 +22,12 @@ public:
 
   // Store definitions, includes and flags.
   void AddDefine(const std::string& define);
-  void AddDefines(const char* defines);
+  void AddDefines(std::string const& defines);
   void AddDefines(const std::vector<std::string>& defines);
   std::vector<std::string> const& GetDefines() const;
 
   void AddInclude(const std::string& includes);
-  void AddIncludes(const char* includes);
+  void AddIncludes(std::string const& includes);
   void AddIncludes(const std::vector<std::string>& includes);
   std::vector<std::string> const& GetIncludes() const;
 
@@ -95,11 +95,12 @@ protected:
     FlagTableCount = 16
   };
   cmIDEFlagTable const* FlagTable[FlagTableCount];
-  void HandleFlag(const char* flag);
-  bool CheckFlagTable(cmIDEFlagTable const* table, const char* flag,
+  void HandleFlag(std::string const& flag);
+  bool CheckFlagTable(cmIDEFlagTable const* table, std::string const& flag,
                       bool& flag_handled);
-  void FlagMapUpdate(cmIDEFlagTable const* entry, const char* new_value);
-  virtual void StoreUnknownFlag(const char* flag) = 0;
+  void FlagMapUpdate(cmIDEFlagTable const* entry,
+                     std::string const& new_value);
+  virtual void StoreUnknownFlag(std::string const& flag) = 0;
 };
 
 #endif
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 16d5381..500a0aa 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1678,8 +1678,8 @@ bool cmLocalVisualStudio7Generator::WriteGroup(
             }
             Options fileOptions(this, tool, table, gg->ExtraFlagTable);
             fileOptions.Parse(fc.CompileFlags.c_str());
-            fileOptions.AddDefines(fc.CompileDefs.c_str());
-            fileOptions.AddDefines(fc.CompileDefsConfig.c_str());
+            fileOptions.AddDefines(fc.CompileDefs);
+            fileOptions.AddDefines(fc.CompileDefsConfig);
             // validate source level include directories
             std::vector<std::string> includes;
             this->AppendIncludeDirectories(includes, fc.IncludeDirs, **sf);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index c7b60b9..ed4a201 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2138,7 +2138,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
         clOptions.AddDefines(
           genexInterpreter.Evaluate(configDefines, "COMPILE_DEFINITIONS"));
       } else {
-        clOptions.AddDefines(configDefines.c_str());
+        clOptions.AddDefines(configDefines);
       }
       std::vector<std::string> includeList;
       if (configDependentIncludes) {
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index fb74fda..2095d23 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -331,7 +331,7 @@ void cmVisualStudioGeneratorOptions::Parse(const char* flags)
   // Process flags that need to be represented specially in the IDE
   // project file.
   for (std::string const& ai : args) {
-    this->HandleFlag(ai.c_str());
+    this->HandleFlag(ai);
   }
 }
 
@@ -393,23 +393,23 @@ void cmVisualStudioGeneratorOptions::Reparse(std::string const& key)
   this->Parse(original.c_str());
 }
 
-void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag)
+void cmVisualStudioGeneratorOptions::StoreUnknownFlag(std::string const& flag)
 {
   // Look for Intel Fortran flags that do not map well in the flag table.
   if (this->CurrentTool == FortranCompiler) {
-    if (strcmp(flag, "/dbglibs") == 0) {
+    if (flag == "/dbglibs") {
       this->FortranRuntimeDebug = true;
       return;
     }
-    if (strcmp(flag, "/threads") == 0) {
+    if (flag == "/threads") {
       this->FortranRuntimeMT = true;
       return;
     }
-    if (strcmp(flag, "/libs:dll") == 0) {
+    if (flag == "/libs:dll") {
       this->FortranRuntimeDLL = true;
       return;
     }
-    if (strcmp(flag, "/libs:static") == 0) {
+    if (flag == "/libs:static") {
       this->FortranRuntimeDLL = false;
       return;
     }
@@ -417,7 +417,7 @@ void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag)
 
   // This option is not known.  Store it in the output flags.
   std::string const opts = cmOutputConverter::EscapeWindowsShellArgument(
-    flag, cmOutputConverter::Shell_Flag_AllowMakeVariables |
+    flag.c_str(), cmOutputConverter::Shell_Flag_AllowMakeVariables |
       cmOutputConverter::Shell_Flag_VSIDE);
   this->AppendFlagString(this->UnknownFlagField, opts);
 }
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 2c56d42..5c3e415 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -107,7 +107,7 @@ private:
 
   std::string UnknownFlagField;
 
-  virtual void StoreUnknownFlag(const char* flag);
+  void StoreUnknownFlag(std::string const& flag) override;
 
   FlagValue TakeFlag(std::string const& key);
 };

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

Summary of changes:
 Modules/FindJava.cmake                     |    8 +++---
 Source/cmIDEOptions.cxx                    |   42 +++++++++++++++-------------
 Source/cmIDEOptions.h                      |   13 +++++----
 Source/cmLocalVisualStudio7Generator.cxx   |    4 +--
 Source/cmMakefileTargetGenerator.cxx       |   41 +++++++++++++++++----------
 Source/cmNinjaTargetGenerator.cxx          |   39 +++++++++++++++++---------
 Source/cmVisualStudio10TargetGenerator.cxx |    2 +-
 Source/cmVisualStudioGeneratorOptions.cxx  |   14 +++++-----
 Source/cmVisualStudioGeneratorOptions.h    |    2 +-
 Source/cmcmd.cxx                           |   26 +++++++++++------
 10 files changed, 114 insertions(+), 77 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list