summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2017-05-25 21:01:30 +0000
committerAaron Ballman <aaron@aaronballman.com>2017-05-25 21:01:30 +0000
commit472278a52e307e1a206bd196a3979866ed1e8da7 (patch)
tree57b0a071b5f55f108c4c484ca42222625876419d
parentf3509b6d9b8beba2e54aefb3052f1920246d00b4 (diff)
downloadbcm5719-llvm-472278a52e307e1a206bd196a3979866ed1e8da7.tar.gz
bcm5719-llvm-472278a52e307e1a206bd196a3979866ed1e8da7.zip
Update the documentation and CMake file for Visual Studio generators.
By default, CMake uses a 32-bit toolchain, even when on a 64-bit platform targeting a 64-bit build. However, due to the size of the binaries involved, this can cause linker instabilities (such as the linker running out of memory). Guide people to the correct solution to get CMake to use the native toolchain. llvm-svn: 303912
-rw-r--r--llvm/CMakeLists.txt7
-rw-r--r--llvm/docs/GettingStartedVS.rst4
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 78e2e016625..a5b96569f9c 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -44,6 +44,13 @@ if (NOT PACKAGE_VERSION)
"${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}")
endif()
+if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_GENERATOR_TOOLSET STREQUAL ""))
+ message(WARNING "Visual Studio generators use the x86 host compiler by "
+ "default, even for 64-bit targets. This can result in linker "
+ "instability and out of memory errors. To use the 64-bit "
+ "host compiler, pass -Thost=x64 on the CMake command line.")
+endif()
+
project(LLVM
${cmake_3_0_PROJ_VERSION}
${cmake_3_0_LANGUAGES}
diff --git a/llvm/docs/GettingStartedVS.rst b/llvm/docs/GettingStartedVS.rst
index 1e467676793..50f7aa123c5 100644
--- a/llvm/docs/GettingStartedVS.rst
+++ b/llvm/docs/GettingStartedVS.rst
@@ -100,6 +100,10 @@ Here's the short story for getting up and running quickly with LLVM:
* CMake generates project files for all build types. To select a specific
build type, use the Configuration manager from the VS IDE or the
``/property:Configuration`` command line option when using MSBuild.
+ * By default, the Visual Studio project files generated by CMake use the
+ 32-bit toolset. If you are developing on a 64-bit version of Windows and
+ want to use the 64-bit toolset, pass the ``-Thost=x64`` flag when
+ generating the Visual Studio solution. This requires CMake 3.8.0 or later.
6. Start Visual Studio
OpenPOWER on IntegriCloud