[Cmake-commits] CMake branch, master, updated. v3.13.3-1171-gfa7077e

Kitware Robot kwrobot at kitware.com
Tue Jan 29 09:13:04 EST 2019


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  fa7077e7411f4f85724deae3427acb29be729567 (commit)
       via  0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc (commit)
       via  17cef3806d958bd03ec08b925fe585a0cfa204fa (commit)
       via  bf774e521b0a08dd8e09a93f76471cad593db3c6 (commit)
       via  142e67eac64613a836dd21542963878104c9b088 (commit)
      from  eeb34232fc2b76dc8b9bde25b2ca696d91b51b5a (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=fa7077e7411f4f85724deae3427acb29be729567
commit fa7077e7411f4f85724deae3427acb29be729567
Merge: eeb3423 0fd742a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 29 14:05:44 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Jan 29 09:05:51 2019 -0500

    Merge topic 'vs-host-arch'
    
    0fd742a6ff VS: Teach VS 2019 generator to select host tools matching host arch
    17cef3806d VS: Add support for explicit 32-bit toolset selection via host=x86
    bf774e521b VS: Remove stray semicolons from VS 2019 implementation
    142e67eac6 VS: Use internal abstraction for VCTargetsPath host arch
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2870


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc
commit 0fd742a6ffa637b8ccac3b61b42bd10b2c3a87cc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 28 10:49:16 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 28 12:58:21 2019 -0500

    VS: Teach VS 2019 generator to select host tools matching host arch
    
    This generator is new so we can introduce the long-desired behavior
    of selecting ``host=x64`` tools by default on x64 hosts.

diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
index 9d3da8b..b456554 100644
--- a/Help/generator/Visual Studio 16 2019.rst	
+++ b/Help/generator/Visual Studio 16 2019.rst	
@@ -47,6 +47,7 @@ default.  The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
 via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
 
 .. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
-   By default this generator uses the 32-bit variant even on a 64-bit host.
+   By default this generator uses the 64-bit variant on x64 hosts and
+   the 32-bit variant otherwise.
 
 .. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/release/dev/vs2019.rst b/Help/release/dev/vs2019.rst
index 2072147..ee9a2f2 100644
--- a/Help/release/dev/vs2019.rst
+++ b/Help/release/dev/vs2019.rst
@@ -10,4 +10,5 @@ vs2019
   in the generator name.  Instead :variable:`CMAKE_GENERATOR_PLATFORM`
   must be used, e.g. through the ``-A`` command-line option.  Furthermore,
   the default target platform (architecture) is now based on the *host*
-  platform.
+  platform.  The VS host toolset selection is now based on the host
+  architecture as well.
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 4dae479..99e9173 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -607,10 +607,26 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetVersionString() const
 const char*
 cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitecture() const
 {
+  std::string const& hostArch =
+    this->GetPlatformToolsetHostArchitectureString();
+  if (hostArch.empty()) {
+    return nullptr;
+  }
+  return hostArch.c_str();
+}
+
+std::string const&
+cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitectureString()
+  const
+{
   if (!this->GeneratorToolsetHostArchitecture.empty()) {
-    return this->GeneratorToolsetHostArchitecture.c_str();
+    return this->GeneratorToolsetHostArchitecture;
   }
-  return nullptr;
+  if (!this->DefaultPlatformToolsetHostArchitecture.empty()) {
+    return this->DefaultPlatformToolsetHostArchitecture;
+  }
+  static std::string const empty;
+  return empty;
 }
 
 const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetCuda() const
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 7c8918a..f496357 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -58,6 +58,7 @@ public:
 
   /** The toolset host architecture name (e.g. x64 for 64-bit host tools).  */
   const char* GetPlatformToolsetHostArchitecture() const;
+  std::string const& GetPlatformToolsetHostArchitectureString() const;
 
   /** The cuda toolset version.  */
   const char* GetPlatformToolsetCuda() const;
@@ -152,6 +153,7 @@ protected:
   std::string GeneratorToolsetHostArchitecture;
   std::string GeneratorToolsetCuda;
   std::string DefaultPlatformToolset;
+  std::string DefaultPlatformToolsetHostArchitecture;
   std::string WindowsTargetPlatformVersion;
   std::string SystemName;
   std::string SystemVersion;
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index b019f39..bc6b453 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -11,10 +11,13 @@
 
 #if defined(_M_ARM64)
 #  define HOST_PLATFORM_NAME "ARM64"
+#  define HOST_TOOLS_ARCH ""
 #elif defined(_M_ARM)
 #  define HOST_PLATFORM_NAME "ARM"
+#  define HOST_TOOLS_ARCH ""
 #elif defined(_M_IA64)
 #  define HOST_PLATFORM_NAME "Itanium"
+#  define HOST_TOOLS_ARCH ""
 #else
 #  include "cmsys/SystemInformation.hxx"
 #endif
@@ -33,6 +36,20 @@ static std::string VSHostPlatformName()
 #endif
 }
 
+static std::string VSHostArchitecture()
+{
+#ifdef HOST_TOOLS_ARCH
+  return HOST_TOOLS_ARCH;
+#else
+  cmsys::SystemInformation info;
+  if (info.Is64Bits()) {
+    return "x64";
+  } else {
+    return "x86";
+  }
+#endif
+}
+
 static unsigned int VSVersionToMajor(
   cmGlobalVisualStudioGenerator::VSVersion v)
 {
@@ -262,6 +279,7 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
   this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
   if (this->Version >= cmGlobalVisualStudioGenerator::VS16) {
     this->DefaultPlatformName = VSHostPlatformName();
+    this->DefaultPlatformToolsetHostArchitecture = VSHostArchitecture();
   }
 }
 
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
index 576b40c..e5e6c8d 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
@@ -1,2 +1,2 @@
 -- CMAKE_VS_PLATFORM_TOOLSET='Test Toolset'
--- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE=''
+-- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='.*'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
index 26926f9..085bb6b 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
@@ -1,2 +1,15 @@
 message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
 message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}'")
+
+if(CMAKE_GENERATOR MATCHES "Visual Studio 1[6]")
+  cmake_host_system_information(RESULT is_64_bit QUERY IS_64BIT)
+  if(is_64_bit)
+    if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "x64")
+      message(FATAL_ERROR "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is not 'x64' as expected.")
+    endif()
+  endif()
+else()
+  if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "")
+    message(FATAL_ERROR "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is not empty as expected.")
+  endif()
+endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17cef3806d958bd03ec08b925fe585a0cfa204fa
commit 17cef3806d958bd03ec08b925fe585a0cfa204fa
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 28 10:44:51 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 28 11:22:50 2019 -0500

    VS: Add support for explicit 32-bit toolset selection via host=x86
    
    Generalize the ``host=x64`` option in `CMAKE_GENERATOR_TOOLSET`
    to also support ``host=x86``.

diff --git a/Help/generator/VS_TOOLSET_HOST_ARCH.txt b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
index 5d13e77..4eb900f 100644
--- a/Help/generator/VS_TOOLSET_HOST_ARCH.txt
+++ b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
@@ -1,6 +1,7 @@
 For each toolset that comes with this version of Visual Studio, there are
 variants that are themselves compiled for 32-bit (x86) and 64-bit (x64) hosts
-(independent of the architecture they target).  By default Visual Studio
-chooses the 32-bit variant even on a 64-bit host.  One may request use of the
-64-bit host tools by adding a ``host=x64`` option to the toolset specification.
+(independent of the architecture they target).
+|VS_TOOLSET_HOST_ARCH_DEFAULT|
+One may explicitly request use of either the 32-bit or 64-bit host tools
+by adding either ``host=x86`` or ``host=x64`` to the toolset specification.
 See the :variable:`CMAKE_GENERATOR_TOOLSET` variable for details.
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
index d342c53..fb8e021 100644
--- a/Help/generator/Visual Studio 12 2013.rst	
+++ b/Help/generator/Visual Studio 12 2013.rst	
@@ -42,4 +42,7 @@ The ``v120`` toolset that comes with Visual Studio 12 2013 is selected by
 default.  The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
 via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
 
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+   By default this generator uses the 32-bit variant even on a 64-bit host.
+
 .. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst
index 106b7c5..7383f7a 100644
--- a/Help/generator/Visual Studio 14 2015.rst	
+++ b/Help/generator/Visual Studio 14 2015.rst	
@@ -39,4 +39,7 @@ The ``v140`` toolset that comes with Visual Studio 14 2015 is selected by
 default.  The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
 via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
 
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+   By default this generator uses the 32-bit variant even on a 64-bit host.
+
 .. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index 52c1fa0..7e6f0fb 100644
--- a/Help/generator/Visual Studio 15 2017.rst	
+++ b/Help/generator/Visual Studio 15 2017.rst	
@@ -56,4 +56,7 @@ The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by
 default.  The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
 via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
 
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+   By default this generator uses the 32-bit variant even on a 64-bit host.
+
 .. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
index 6f2bc56..9d3da8b 100644
--- a/Help/generator/Visual Studio 16 2019.rst	
+++ b/Help/generator/Visual Studio 16 2019.rst	
@@ -46,4 +46,7 @@ The ``v142`` toolset that comes with Visual Studio 16 2019 is selected by
 default.  The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
 via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
 
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+   By default this generator uses the 32-bit variant even on a 64-bit host.
+
 .. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index e9bc28b..e77f211 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -44,8 +44,8 @@ Supported pairs are:
   and above with the CUDA toolkit VS integration installed.
   See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_CUDA` variable.
 
-``host=x64``
-  Request use of the native ``x64`` toolchain on ``x64`` hosts.
+``host=<arch>``
+  Specify the host tools architecture as ``x64`` or ``x86``.
   Supported by VS 2013 and above.
   See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE`
   variable.
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
index 9b59c52..99ac90d 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
@@ -3,8 +3,8 @@ CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
 
 Visual Studio preferred tool architecture.
 
-The :ref:`Visual Studio Generators` for VS 2013 and above support optional
-selection of a 64-bit toolchain on 64-bit hosts by specifying a ``host=x64``
-value in the :variable:`CMAKE_GENERATOR_TOOLSET` option.  CMake provides
-the selected toolchain architecture preference in this variable (either
-``x64`` or empty).
+The :ref:`Visual Studio Generators` for VS 2013 and above support using
+either the 32-bit or 64-bit host toolchains by specifying a ``host=x86``
+or ``host=x64`` value in the :variable:`CMAKE_GENERATOR_TOOLSET` option.
+CMake provides the selected toolchain architecture preference in this
+variable (``x86``, ``x64``, or empty).
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index 8b50684..d9702c9 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -126,8 +126,8 @@ bool cmGlobalVisualStudio12Generator::MatchesGeneratorName(
 bool cmGlobalVisualStudio12Generator::ProcessGeneratorToolsetField(
   std::string const& key, std::string const& value)
 {
-  if (key == "host" && value == "x64") {
-    this->GeneratorToolsetHostArchitecture = "x64";
+  if (key == "host" && (value == "x64" || value == "x86")) {
+    this->GeneratorToolsetHostArchitecture = value;
     return true;
   }
   return this->cmGlobalVisualStudio11Generator::ProcessGeneratorToolsetField(
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
index 164d3aa..7067423 100644
--- a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
@@ -5,6 +5,6 @@ CMake Error at CMakeLists.txt:[0-9]+ \(project\):
 
   given toolset specification
 
-    Test Toolset,host=x64,host=x64
+    Test Toolset,host=x64,host=x86
 
   that contains duplicate field key 'host'\.$
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index ccf58b4..ef8fd25 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -16,14 +16,16 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
     set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64")
     run_cmake(TestToolsetHostArchBoth)
     set(RunCMake_GENERATOR_TOOLSET ",host=x64")
-    run_cmake(TestToolsetHostArchOnly)
+    run_cmake(TestToolsetHostArchOnly_x64)
     set(RunCMake_GENERATOR_TOOLSET "host=x64")
-    run_cmake(TestToolsetHostArchOnly)
+    run_cmake(TestToolsetHostArchOnly_x64)
+    set(RunCMake_GENERATOR_TOOLSET "host=x86")
+    run_cmake(TestToolsetHostArchOnly_x86)
     set(RunCMake_GENERATOR_TOOLSET "Test Toolset")
     run_cmake(TestToolsetHostArchNone)
     set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x65")
     run_cmake(BadToolsetHostArch)
-    set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x64")
+    set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86")
     run_cmake(BadToolsetHostArchTwice)
     if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]")
       set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version")
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt
similarity index 100%
rename from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt
rename to Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake
similarity index 100%
copy from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake
copy to Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt
new file mode 100644
index 0000000..c7293dc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt
@@ -0,0 +1,2 @@
+-- CMAKE_VS_PLATFORM_TOOLSET='v[0-9]+'
+-- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='x86'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake
similarity index 100%
rename from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake
rename to Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf774e521b0a08dd8e09a93f76471cad593db3c6
commit bf774e521b0a08dd8e09a93f76471cad593db3c6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 28 11:21:23 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 28 11:22:31 2019 -0500

    VS: Remove stray semicolons from VS 2019 implementation

diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index a83cc78..b019f39 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -10,11 +10,11 @@
 #include "cmake.h"
 
 #if defined(_M_ARM64)
-#  define HOST_PLATFORM_NAME "ARM64";
+#  define HOST_PLATFORM_NAME "ARM64"
 #elif defined(_M_ARM)
-#  define HOST_PLATFORM_NAME "ARM";
+#  define HOST_PLATFORM_NAME "ARM"
 #elif defined(_M_IA64)
-#  define HOST_PLATFORM_NAME "Itanium";
+#  define HOST_PLATFORM_NAME "Itanium"
 #else
 #  include "cmsys/SystemInformation.hxx"
 #endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=142e67eac64613a836dd21542963878104c9b088
commit 142e67eac64613a836dd21542963878104c9b088
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 28 10:32:06 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 28 11:16:02 2019 -0500

    VS: Use internal abstraction for VCTargetsPath host arch
    
    Call our internal host architecture lookup method rather than directly
    accessing a member used by its implementation.

diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 9a8014c..4dae479 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -786,10 +786,9 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
     }
     cmXMLElement(eprj, "Import")
       .Attribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
-    if (!this->GeneratorToolsetHostArchitecture.empty()) {
+    if (const char* hostArch = this->GetPlatformToolsetHostArchitecture()) {
       cmXMLElement epg(eprj, "PropertyGroup");
-      cmXMLElement(epg, "PreferredToolArchitecture")
-        .Content(this->GeneratorToolsetHostArchitecture);
+      cmXMLElement(epg, "PreferredToolArchitecture").Content(hostArch);
     }
     {
       cmXMLElement epg(eprj, "PropertyGroup");

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

Summary of changes:
 Help/generator/VS_TOOLSET_HOST_ARCH.txt            |  7 +++---
 Help/generator/Visual Studio 12 2013.rst           |  3 +++
 Help/generator/Visual Studio 14 2015.rst           |  3 +++
 Help/generator/Visual Studio 15 2017.rst           |  3 +++
 Help/generator/Visual Studio 16 2019.rst           |  4 ++++
 Help/release/dev/vs2019.rst                        |  3 ++-
 Help/variable/CMAKE_GENERATOR_TOOLSET.rst          |  4 ++--
 ...CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst | 10 ++++-----
 Source/cmGlobalVisualStudio10Generator.cxx         | 25 +++++++++++++++++-----
 Source/cmGlobalVisualStudio10Generator.h           |  2 ++
 Source/cmGlobalVisualStudio12Generator.cxx         |  4 ++--
 Source/cmGlobalVisualStudioVersionedGenerator.cxx  | 24 ++++++++++++++++++---
 .../BadToolsetHostArchTwice-stderr.txt             |  2 +-
 Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake |  8 ++++---
 .../TestToolsetHostArchNone-stdout.txt             |  2 +-
 .../GeneratorToolset/TestToolsetHostArchNone.cmake | 13 +++++++++++
 ....txt => TestToolsetHostArchOnly_x64-stdout.txt} |  0
 ...nly.cmake => TestToolsetHostArchOnly_x64.cmake} |  0
 .../TestToolsetHostArchOnly_x86-stdout.txt         |  2 ++
 ...nly.cmake => TestToolsetHostArchOnly_x86.cmake} |  0
 20 files changed, 93 insertions(+), 26 deletions(-)
 rename Tests/RunCMake/GeneratorToolset/{TestToolsetHostArchOnly-stdout.txt => TestToolsetHostArchOnly_x64-stdout.txt} (100%)
 copy Tests/RunCMake/GeneratorToolset/{TestToolsetHostArchOnly.cmake => TestToolsetHostArchOnly_x64.cmake} (100%)
 create mode 100644 Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt
 rename Tests/RunCMake/GeneratorToolset/{TestToolsetHostArchOnly.cmake => TestToolsetHostArchOnly_x86.cmake} (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list