From cff0971773e902770114c9f262a64898059bfa11 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sun, 12 Mar 2017 21:21:34 +0300 Subject: vcpkg_build_msbuild: add TARGET_PLATFORM_VERSION property --- scripts/cmake/vcpkg_build_msbuild.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index f4a809e7f..7de06241c 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -7,6 +7,7 @@ # vcpkg_build_msbuild(PROJECT_PATH # [RELEASE_CONFIGURATION ] # (default = "Release") # [DEBUG_CONFIGURATION ] @ (default = "Debug") +# [TARGET_PLATFORM_VERSION ] # [PLATFORM ] # (default = "${TRIPLET_SYSTEM_ARCH}") # [OPTIONS arg1 [arg2 ...]] # [OPTIONS_RELEASE arg1 [arg2 ...]] @@ -21,9 +22,8 @@ # ``DEBUG_CONFIGURATION`` # The configuration (``/p:Configuration`` msbuild parameter) # used for Debug builds. -# ``DEBUG_CONFIGURATION`` -# The configuration (``/p:Configuration`` msbuild parameter) -# used for Debug builds. +# ``TARGET_PLATFORM_VERSION`` +# The WindowsTargetPlatformVersion (``/p:WindowsTargetPlatformVersion`` msbuild parameter) # ``PLATFORM`` # The platform (``/p:Platform`` msbuild parameter) # used for the build. @@ -36,7 +36,7 @@ # function(vcpkg_build_msbuild) - cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN}) + cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;TARGET_PLATFORM_VERSION" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN}) if(NOT DEFINED _csc_RELEASE_CONFIGURATION) set(_csc_RELEASE_CONFIGURATION Release) @@ -47,6 +47,9 @@ function(vcpkg_build_msbuild) if(NOT DEFINED _csc_PLATFORM) set(_csc_PLATFORM ${TRIPLET_SYSTEM_ARCH}) endif() + if(DEFINED _csc_TARGET_PLATFORM_VERSION) + set(_csc_TARGET_PLATFORM_VERSION /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION}) + endif() message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) @@ -56,6 +59,7 @@ function(vcpkg_build_msbuild) /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No + ${_csc_TARGET_PLATFORM_VERSION} /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel @@ -69,6 +73,7 @@ function(vcpkg_build_msbuild) /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No + ${_csc_TARGET_PLATFORM_VERSION} /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg -- cgit v1.2.3 From 8fc1447da763ffccd06efe171f1827ec018d2da2 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 13 Mar 2017 14:02:28 -0700 Subject: [vcpkg_build_msbuild] Default to overriding WinSDK version --- scripts/cmake/vcpkg_build_msbuild.cmake | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index 7de06241c..d143a6a81 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -47,20 +47,25 @@ function(vcpkg_build_msbuild) if(NOT DEFINED _csc_PLATFORM) set(_csc_PLATFORM ${TRIPLET_SYSTEM_ARCH}) endif() - if(DEFINED _csc_TARGET_PLATFORM_VERSION) - set(_csc_TARGET_PLATFORM_VERSION /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION}) + if(NOT DEFINED _csc_TARGET_PLATFORM_VERSION) + vcpkg_get_windows_sdk(_csc_TARGET_PLATFORM_VERSION) endif() + list(APPEND _csc_OPTIONS + /p:Platform=${_csc_PLATFORM} + /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No + /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /m + ) + message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( - COMMAND msbuild ${_csc_PROJECT_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} + COMMAND msbuild ${_csc_PROJECT_PATH} /p:Configuration=${_csc_RELEASE_CONFIGURATION} - /p:Platform=${_csc_PLATFORM} - /p:VCPkgLocalAppDataDisabled=true - /p:UseIntelMKL=No - ${_csc_TARGET_PLATFORM_VERSION} - /m + ${_csc_OPTIONS} + ${_csc_OPTIONS_RELEASE} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -68,13 +73,10 @@ function(vcpkg_build_msbuild) message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) vcpkg_execute_required_process( - COMMAND msbuild ${_csc_PROJECT_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} + COMMAND msbuild ${_csc_PROJECT_PATH} /p:Configuration=${_csc_DEBUG_CONFIGURATION} - /p:Platform=${_csc_PLATFORM} - /p:VCPkgLocalAppDataDisabled=true - /p:UseIntelMKL=No - ${_csc_TARGET_PLATFORM_VERSION} - /m + ${_csc_OPTIONS} + ${_csc_OPTIONS_DEBUG} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) -- cgit v1.2.3 From 26b9278a4c73eebb2bf21beccac168d603206126 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 13 Mar 2017 14:08:40 -0700 Subject: [vcpkg_build_msbuild] Perform a full rebuild by default. --- scripts/cmake/vcpkg_build_msbuild.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index d143a6a81..748b47b7b 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -24,6 +24,8 @@ # used for Debug builds. # ``TARGET_PLATFORM_VERSION`` # The WindowsTargetPlatformVersion (``/p:WindowsTargetPlatformVersion`` msbuild parameter) +# ``TARGET`` +# The MSBuild target to build. (``/t:``) # ``PLATFORM`` # The platform (``/p:Platform`` msbuild parameter) # used for the build. @@ -35,8 +37,9 @@ # The options passed to msbuild for Debug builds. # + function(vcpkg_build_msbuild) - cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;TARGET_PLATFORM_VERSION" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN}) + cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;TARGET_PLATFORM_VERSION;TARGET" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN}) if(NOT DEFINED _csc_RELEASE_CONFIGURATION) set(_csc_RELEASE_CONFIGURATION Release) @@ -50,8 +53,12 @@ function(vcpkg_build_msbuild) if(NOT DEFINED _csc_TARGET_PLATFORM_VERSION) vcpkg_get_windows_sdk(_csc_TARGET_PLATFORM_VERSION) endif() + if(NOT DEFINED _csc_TARGET) + set(_csc_TARGET Rebuild) + endif() list(APPEND _csc_OPTIONS + /t:${_csc_TARGET} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No -- cgit v1.2.3