diff options
| author | glachancecmaisonneuve <glachance@cmaisonneuve.qc.ca> | 2017-09-25 13:05:32 -0400 |
|---|---|---|
| committer | glachancecmaisonneuve <glachance@cmaisonneuve.qc.ca> | 2017-09-25 13:05:32 -0400 |
| commit | 06798b6528b777ba2e2a9af59774309db5cf5e52 (patch) | |
| tree | d4401b40f8b76411605c8d3c4225fd420100dc66 /scripts | |
| parent | a9f12be8f6e667afc2962df954d0898e897428a8 (diff) | |
| download | vcpkg-06798b6528b777ba2e2a9af59774309db5cf5e52.tar.gz vcpkg-06798b6528b777ba2e2a9af59774309db5cf5e52.zip | |
Fix for BUILD_ARGS being always added in non ninja build
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cmake/vcpkg_build_cmake.cmake | 30 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_install_cmake.cmake | 6 |
2 files changed, 33 insertions, 3 deletions
diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 18e2a8b00..546071a36 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,3 +1,29 @@ +## # vcpkg_build_cmake +## +## Build a cmake project. +## +## ## Usage: +## ```cmake +## vcpkg_build_cmake([MSVC_64_TOOLSET] [DISABLE_PARALLEL]) +## ``` +## +## ## Parameters: +## ### MSVC_64_TOOLSET +## This adds the `/p:PreferredToolArchitecture=x64` switch to the underlying buildsystem parameters. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. +## +## ### DISABLE_PARALLEL +## The /m parameter will not be added to the underlying buildsystem parameters +## +## ## Notes: +## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). +## Use [`vcpkg_install_cmake()`](vcpkg_configure_cmake.md) function if your CMake script supports the "install" target +## +## ## Examples: +## +## * [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +## * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) +## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_build_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) @@ -19,7 +45,9 @@ function(vcpkg_build_cmake) if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) set(BUILD_ARGS -v) # verbose output - else() + endif() + + if(_bc_MSVC_64_TOOLSET) set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) endif() diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index f778007ef..34ac15fe6 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -9,7 +9,7 @@ ## ## ## Parameters: ## ### MSVC_64_TOOLSET -## This adds the `/p:PreferredToolArchitecture=x64` switch if the underlying buildsystem is MSBuild. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. +## This adds the `/p:PreferredToolArchitecture=x64` switch to the underlying buildsystem parameters. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. ## ## ## Notes: ## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). @@ -41,7 +41,9 @@ function(vcpkg_install_cmake) if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) set(BUILD_ARGS -v) # verbose output - else() + endif() + + if(_bc_MSVC_64_TOOLSET) set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) endif() |
