From 95af9aac7c39765d1524b7c9c39dc283e9f0facf Mon Sep 17 00:00:00 2001 From: codicodi Date: Fri, 3 Feb 2017 17:16:13 +0100 Subject: Add Ninja support --- scripts/cmake/vcpkg_build_cmake.cmake | 12 +++++++++--- scripts/cmake/vcpkg_configure_cmake.cmake | 14 ++++++++++---- scripts/cmake/vcpkg_find_acquire_program.cmake | 16 ++++++++++++---- scripts/cmake/vcpkg_install_cmake.cmake | 12 +++++++++--- scripts/templates/portfile.in.cmake | 1 + 5 files changed, 41 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 6d7cfe643..2e73a72d6 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,7 +1,7 @@ function(vcpkg_build_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - set(MSVC_EXTRA_ARGS) + set(MSVC_EXTRA_ARGS /p:VCPkgLocalAppDataDisabled=true) # Specifies the architecture of the toolset, NOT the architecture of the produced binary if (_bc_MSVC_64_TOOLSET) @@ -12,9 +12,15 @@ function(vcpkg_build_cmake) list(APPEND MSVC_EXTRA_ARGS "/m") endif() + if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) + set(BUILD_ARGS -v) # verbose output + else() + set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) + endif() + message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -22,7 +28,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index fbebe13a4..42570226f 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -1,6 +1,5 @@ -find_program(vcpkg_configure_cmake_NINJA ninja) function(vcpkg_configure_cmake) - cmake_parse_arguments(_csc "" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + cmake_parse_arguments(_csc "PREFER_NINJA" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) if(NOT VCPKG_PLATFORM_TOOLSET) message(FATAL_ERROR "Vcpkg has been updated with VS2017 support, however you need to rebuild vcpkg.exe by re-running bootstrap.ps1\n powershell -exec bypass scripts\\bootstrap.ps1\n") @@ -8,14 +7,14 @@ function(vcpkg_configure_cmake) if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) + elseif(_csc_PREFER_NINJA AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(GENERATOR "Ninja") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 ARM") - # elseif(NOT vcpkg_configure_cmake_NINJA MATCHES "NOTFOUND") - # set(GENERATOR "Ninja") elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") @@ -36,6 +35,13 @@ function(vcpkg_configure_cmake) elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") set(GENERATOR "Visual Studio 15 2017 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") endif() + + # If we use Ninja, make sure it's on PATH + if(GENERATOR STREQUAL "Ninja") + vcpkg_find_acquire_program(NINJA) + get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + set(ENV{PATH} "${NINJA_PATH};$ENV{PATH}") + endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index cd4a554f4..044291382 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -4,6 +4,7 @@ function(vcpkg_find_acquire_program VAR) endif() unset(NOEXTRACT) + unset(SUBDIR) if(VAR MATCHES "PERL") set(PROGNAME perl) @@ -63,6 +64,13 @@ function(vcpkg_find_acquire_program VAR) set(URL "http://7-zip.org/a/7z1604.msi") set(ARCHIVE "7z1604.msi") set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) + elseif(VAR MATCHES "NINJA") + set(PROGNAME ninja) + set(SUBDIR "ninja-1.7.2") + set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR}) + set(URL "https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip") + set(ARCHIVE "ninja-win.zip") + set(HASH cccab9281b274c564f9ad77a2115be1f19be67d7b2ee14a55d1db1b27f3b68db8e76076e4f804b61eb8e573e26a8ecc9985675a8dcf03fd7a77b7f57234f1393) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() @@ -73,15 +81,15 @@ function(vcpkg_find_acquire_program VAR) EXPECTED_HASH SHA512=${HASH} SHOW_PROGRESS ) - file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}) + file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) if(DEFINED NOEXTRACT) - file(COPY ${DOWNLOADS}/${ARCHIVE} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}) + file(COPY ${DOWNLOADS}/${ARCHIVE} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) else() get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) if(${ARCHIVE_EXTENSION} STREQUAL ".msi") file(TO_NATIVE_PATH "${DOWNLOADS}/${ARCHIVE}" ARCHIVE_NATIVE_PATH) - file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}" DESTINATION_NATIVE_PATH) + file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}" DESTINATION_NATIVE_PATH) execute_process( COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} WORKING_DIRECTORY ${DOWNLOADS} @@ -89,7 +97,7 @@ function(vcpkg_find_acquire_program VAR) else() execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} - WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME} + WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} ) endif() endif() diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index f29f3ce5d..5997fa764 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -1,7 +1,7 @@ function(vcpkg_install_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - set(MSVC_EXTRA_ARGS) + set(MSVC_EXTRA_ARGS /p:VCPkgLocalAppDataDisabled=true) # Specifies the architecture of the toolset, NOT the architecture of the produced binary if (_bc_MSVC_64_TOOLSET) @@ -11,10 +11,16 @@ function(vcpkg_install_cmake) if (NOT _bc_DISABLE_PARALLEL) list(APPEND MSVC_EXTRA_ARGS "/m") endif() + + if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) + set(BUILD_ARGS -v) # verbose output + else() + set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) + endif() message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) @@ -22,7 +28,7 @@ function(vcpkg_install_cmake) message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake index c848b6445..ef72431ff 100644 --- a/scripts/templates/portfile.in.cmake +++ b/scripts/templates/portfile.in.cmake @@ -17,6 +17,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 -- cgit v1.2.3 From 116b1b8c66afbe11719c42d03d342bb6fe5d58b0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Feb 2017 17:39:31 -0800 Subject: Reorder path alterations to generally append instead of prepend. This solves the issue where some software bundles (git) provide multiple executables in the same folder, which can override other desired programs (link.exe). --- scripts/cmake/vcpkg_configure_cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 42570226f..85a67a401 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -40,7 +40,7 @@ function(vcpkg_configure_cmake) if(GENERATOR STREQUAL "Ninja") vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) - set(ENV{PATH} "${NINJA_PATH};$ENV{PATH}") + set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) -- cgit v1.2.3 From b6b69025c3c5d64f73faa3445fa3f17c967a8337 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 19:34:19 -0800 Subject: bootstrap.ps1 now detects the available Windows SDKs --- scripts/bootstrap.ps1 | 3 ++- scripts/findTargetPlatformVersion.ps1 | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 scripts/findTargetPlatformVersion.ps1 (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 98ccb40ad..9907e31fb 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -26,7 +26,8 @@ try{ $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] - & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m dirs.proj + $targetPlatformVersion = & $scriptsDir\findTargetPlatformVersion.ps1 + & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$targetPlatformVersion /m dirs.proj Write-Verbose("Placing vcpkg.exe in the correct location") diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/findTargetPlatformVersion.ps1 new file mode 100644 index 000000000..5bc6cf854 --- /dev/null +++ b/scripts/findTargetPlatformVersion.ps1 @@ -0,0 +1,43 @@ +[CmdletBinding()] +param( + +) + +Import-Module BitsTransfer + +$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" + +# Windows 10 SDK +foreach ($ProgramFiles in $CandidateProgramFiles) +{ + $folder = "$ProgramFiles\Windows Kits\10\Include" + if (!(Test-Path $folder)) + { + continue + } + + $win10sdkVersions = Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object + $win10sdkVersionCount = $win10sdkVersions.Length + + if ($win10sdkVersionCount -eq 0) + { + continue + } + + return $win10sdkVersions[$win10sdkVersionCount - 1].ToString() +} + + + +# Windows 8.1 SDK +foreach ($ProgramFiles in $CandidateProgramFiles) +{ + $folder = "$ProgramFiles\Windows Kits\8.1\Include" + if (Test-Path $folder) + { + return "8.1" + } +} + +throw "Could not detect a Windows SDK / TargetPlatformVersion" \ No newline at end of file -- cgit v1.2.3 From 4f8e4af36321708ee0ac98a77cdc45926ad44a58 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 22:31:04 -0800 Subject: Remove unneeded Import-Module --- scripts/findTargetPlatformVersion.ps1 | 4 ---- 1 file changed, 4 deletions(-) (limited to 'scripts') diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/findTargetPlatformVersion.ps1 index 5bc6cf854..e9d676724 100644 --- a/scripts/findTargetPlatformVersion.ps1 +++ b/scripts/findTargetPlatformVersion.ps1 @@ -3,8 +3,6 @@ param( ) -Import-Module BitsTransfer - $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" @@ -28,8 +26,6 @@ foreach ($ProgramFiles in $CandidateProgramFiles) return $win10sdkVersions[$win10sdkVersionCount - 1].ToString() } - - # Windows 8.1 SDK foreach ($ProgramFiles in $CandidateProgramFiles) { -- cgit v1.2.3 From 6ca475a5b47e0a49e2cdd4e65f3c51913a431328 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 9 Feb 2017 18:13:52 +0100 Subject: add libepoxy --- scripts/cmake/vcpkg_common_functions.cmake | 2 + scripts/cmake/vcpkg_configure_meson.cmake | 72 ++++++++++++++++++++++++++ scripts/cmake/vcpkg_find_acquire_program.cmake | 25 +++++++-- scripts/cmake/vcpkg_install_meson.cmake | 23 ++++++++ 4 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 scripts/cmake/vcpkg_configure_meson.cmake create mode 100644 scripts/cmake/vcpkg_install_meson.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 6e60bf2bc..fb626efe8 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -7,7 +7,9 @@ include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) include(vcpkg_install_cmake) +include(vcpkg_install_meson) include(vcpkg_configure_cmake) +include(vcpkg_configure_meson) include(vcpkg_configure_qmake) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake new file mode 100644 index 000000000..277f91e11 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -0,0 +1,72 @@ +function(vcpkg_configure_meson) + cmake_parse_arguments(_vcm "" "SOURCE_PATH" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + # use the same compiler options as in vcpkg_configure_cmake + set(MESON_COMMON_CFLAGS "${MESON_COMMON_CFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8") + set(MESON_COMMON_CXXFLAGS "${MESON_COMMON_CXXFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc") + + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) + set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") + set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") + + set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MD /O2 /Oi /Gy /DNDEBUG /Zi") + set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MD /O2 /Oi /Gy /DNDEBUG /Zi") + elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") + set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") + + set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MT /O2 /Oi /Gy /DNDEBUG /Zi") + set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MT /O2 /Oi /Gy /DNDEBUG /Zi") + endif() + + set(MESON_COMMON_LDFLAGS "${MESON_COMMON_LDFLAGS} /DEBUG") + set(MESON_RELEASE_LDFLAGS "${MESON_RELEASE_LDFLAGS} /INCREMENTAL:NO /OPT:REF /OPT:ICF") + + # select meson cmd-line options + list(APPEND _vcm_OPTIONS --buildtype plain --backend ninja) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND _vcm_OPTIONS --default-library shared) + else() + list(APPEND _vcm_OPTIONS --default-library static) + endif() + + list(APPEND _vcm_OPTIONS_DEBUG --prefix ${CURRENT_PACKAGES_DIR}/debug --includedir ../include) + list(APPEND _vcm_OPTIONS_RELEASE --prefix ${CURRENT_PACKAGES_DIR}) + + vcpkg_find_acquire_program(MESON) + vcpkg_find_acquire_program(NINJA) + get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") + + # configure release + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_RELEASE_CFLAGS}") + set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_RELEASE_CXXFLAGS}") + set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_RELEASE_LDFLAGS}") + set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_RELEASE_CPPFLAGS}") + vcpkg_execute_required_process( + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_RELEASE} ${_vcm_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + + # configure debug + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_DEBUG_CFLAGS}") + set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_DEBUG_CXXFLAGS}") + set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_DEBUG_LDFLAGS}") + set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_DEBUG_CPPFLAGS}") + vcpkg_execute_required_process( + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_DEBUG} ${_vcm_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + +endfunction() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 044291382..b9a397fcc 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -5,6 +5,7 @@ function(vcpkg_find_acquire_program VAR) unset(NOEXTRACT) unset(SUBDIR) + unset(REQUIRED_INTERPRETER) if(VAR MATCHES "PERL") set(PROGNAME perl) @@ -70,12 +71,30 @@ function(vcpkg_find_acquire_program VAR) set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR}) set(URL "https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip") set(ARCHIVE "ninja-win.zip") - set(HASH cccab9281b274c564f9ad77a2115be1f19be67d7b2ee14a55d1db1b27f3b68db8e76076e4f804b61eb8e573e26a8ecc9985675a8dcf03fd7a77b7f57234f1393) + set(HASH cccab9281b274c564f9ad77a2115be1f19be67d7b2ee14a55d1db1b27f3b68db8e76076e4f804b61eb8e573e26a8ecc9985675a8dcf03fd7a77b7f57234f1393) + elseif(VAR MATCHES "MESON") + set(PROGNAME meson) + set(REQUIRED_INTERPRETER PYTHON3) + set(SCRIPTNAME meson.py) + set(PATHS ${DOWNLOADS}/tools/meson/meson-0.38.1) + set(URL "https://github.com/mesonbuild/meson/archive/0.38.1.zip") + set(ARCHIVE "meson-0.38.1.zip") + set(HASH 89642b1d976af7e29e9ca2b1a378510ce286ebd90a8234e898f3dd9dd7151538fdfc61fba770681605dad843b77b344fee94f992f18328655669d5f603c7fee5) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() - find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) + macro(do_find) + if(NOT DEFINED REQUIRED_INTERPRETER) + find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) + else() + vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) + find_file(SCIRPT ${SCRIPTNAME} PATHS ${PATHS}) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCIRPT}) + endif() + endmacro() + + do_find() if(${VAR} MATCHES "-NOTFOUND") file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE} EXPECTED_HASH SHA512=${HASH} @@ -102,7 +121,7 @@ function(vcpkg_find_acquire_program VAR) endif() endif() - find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) + do_find() endif() set(${VAR} ${${VAR}} PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_install_meson.cmake b/scripts/cmake/vcpkg_install_meson.cmake new file mode 100644 index 000000000..21737bdc9 --- /dev/null +++ b/scripts/cmake/vcpkg_install_meson.cmake @@ -0,0 +1,23 @@ +function(vcpkg_install_meson) + + vcpkg_find_acquire_program(NINJA) + + unset(ENV{DESTDIR}) # installation directory was already specified with '--prefix' option + + message(STATUS "Package ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${NINJA} install -v + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME package-${TARGET_TRIPLET}-rel + ) + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${NINJA} install -v + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME package-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + +endfunction() -- cgit v1.2.3 From b65ae7c27793d2837881412f609ee08974c14f82 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 9 Feb 2017 18:15:57 +0100 Subject: tabs to spaces --- scripts/cmake/vcpkg_install_meson.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_install_meson.cmake b/scripts/cmake/vcpkg_install_meson.cmake index 21737bdc9..f6d49288c 100644 --- a/scripts/cmake/vcpkg_install_meson.cmake +++ b/scripts/cmake/vcpkg_install_meson.cmake @@ -1,9 +1,9 @@ function(vcpkg_install_meson) - + vcpkg_find_acquire_program(NINJA) - - unset(ENV{DESTDIR}) # installation directory was already specified with '--prefix' option - + + unset(ENV{DESTDIR}) # installation directory was already specified with '--prefix' option + message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( COMMAND ${NINJA} install -v @@ -11,7 +11,7 @@ function(vcpkg_install_meson) LOGNAME package-${TARGET_TRIPLET}-rel ) message(STATUS "Package ${TARGET_TRIPLET}-rel done") - + message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( COMMAND ${NINJA} install -v -- cgit v1.2.3 From cfd5adaf135ccfe2ade3bce43a00d27abd007b0a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Feb 2017 15:26:40 -0800 Subject: Improve WinSDK detection --- scripts/findTargetPlatformVersion.ps1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/findTargetPlatformVersion.ps1 index e9d676724..d3dba73f1 100644 --- a/scripts/findTargetPlatformVersion.ps1 +++ b/scripts/findTargetPlatformVersion.ps1 @@ -15,15 +15,16 @@ foreach ($ProgramFiles in $CandidateProgramFiles) continue } - $win10sdkVersions = Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object - $win10sdkVersionCount = $win10sdkVersions.Length + $win10sdkVersions = @(Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object) + [array]::Reverse($win10sdkVersions) # Newest SDK first - if ($win10sdkVersionCount -eq 0) + foreach ($win10sdkV in $win10sdkVersions) { - continue + if (Test-Path "$folder\$win10sdkV\um\windows.h") + { + return $win10sdkV.ToString() + } } - - return $win10sdkVersions[$win10sdkVersionCount - 1].ToString() } # Windows 8.1 SDK -- cgit v1.2.3 From 4cef21b894b5ce8507447c6c63fb0f00228b75ec Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 11 Feb 2017 09:51:02 -0800 Subject: [bootstrap] Specify NuGet Source to avoid impact from user config. --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 951975758..9034ddfa8 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -14,7 +14,7 @@ $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.5.125-rc" -$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -nocache 2>&1 +$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -Source "https://api.nuget.org/v3/index.json" -nocache 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" -- cgit v1.2.3 From 444f28dd24f4bffa3e0ee450e8fbbe30340086b4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 16:53:29 -0800 Subject: Add functions to find Program Files folders on the powershell side --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 4 +++- scripts/findTargetPlatformVersion.ps1 | 4 +++- scripts/getProgramFiles32bit.ps1 | 11 +++++++++++ scripts/getProgramFilesPlatformBitness.ps1 | 11 +++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 scripts/getProgramFiles32bit.ps1 create mode 100644 scripts/getProgramFilesPlatformBitness.ps1 (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 1be4a4e6d..d160aea12 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -18,7 +18,9 @@ foreach ($instance in $VisualStudio2017InstallationInstances) } # VS2015 -$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" +$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1 +$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1 +$CandidateProgramFiles = $programFiles32, $programFilesP foreach ($ProgramFiles in $CandidateProgramFiles) { $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe" diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/findTargetPlatformVersion.ps1 index d3dba73f1..650e0b4ed 100644 --- a/scripts/findTargetPlatformVersion.ps1 +++ b/scripts/findTargetPlatformVersion.ps1 @@ -4,7 +4,9 @@ param( ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" +$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1 +$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1 +$CandidateProgramFiles = $programFiles32, $programFilesP # Windows 10 SDK foreach ($ProgramFiles in $CandidateProgramFiles) diff --git a/scripts/getProgramFiles32bit.ps1 b/scripts/getProgramFiles32bit.ps1 new file mode 100644 index 000000000..fd7167191 --- /dev/null +++ b/scripts/getProgramFiles32bit.ps1 @@ -0,0 +1,11 @@ +[CmdletBinding()] +param( + +) + +if (Test-Path env:PROGRAMFILES`(X86`)) +{ + return ${env:PROGRAMFILES(X86)} +} + +return ${env:PROGRAMFILES} \ No newline at end of file diff --git a/scripts/getProgramFilesPlatformBitness.ps1 b/scripts/getProgramFilesPlatformBitness.ps1 new file mode 100644 index 000000000..6d0a513ca --- /dev/null +++ b/scripts/getProgramFilesPlatformBitness.ps1 @@ -0,0 +1,11 @@ +[CmdletBinding()] +param( + +) + +if (Test-Path env:ProgramW6432) +{ + return ${env:ProgramW6432} +} + +return ${env:PROGRAMFILES} \ No newline at end of file -- cgit v1.2.3 From da26d097165b5d06b77e7dcb13bf1b8a8c9c079e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 17:29:47 -0800 Subject: Add functions to find Program Files folders on the CMake side --- scripts/cmake/vcpkg_common_functions.cmake | 2 ++ scripts/cmake/vcpkg_find_acquire_program.cmake | 5 ++++- scripts/cmake/vcpkg_get_program_files_32_bit.cmake | 7 +++++++ scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 scripts/cmake/vcpkg_get_program_files_32_bit.cmake create mode 100644 scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index fb626efe8..50c4ed2dc 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -14,3 +14,5 @@ include(vcpkg_configure_qmake) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) +include(vcpkg_get_program_files_32_bit) +include(vcpkg_get_program_files_platform_bitness) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index b9a397fcc..44e347e04 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -7,6 +7,9 @@ function(vcpkg_find_acquire_program VAR) unset(SUBDIR) unset(REQUIRED_INTERPRETER) + vcpkg_get_program_files_platform_bitness(PROGRAM_FILES_PLATFORM_BITNESS) + vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) + if(VAR MATCHES "PERL") set(PROGNAME perl) set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) @@ -61,7 +64,7 @@ function(vcpkg_find_acquire_program VAR) set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) elseif(VAR MATCHES "7Z") set(PROGNAME 7z) - set(PATHS "C:/Program Files/7-Zip" ${DOWNLOADS}/tools/7z/Files/7-Zip) + set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" ${DOWNLOADS}/tools/7z/Files/7-Zip) set(URL "http://7-zip.org/a/7z1604.msi") set(ARCHIVE "7z1604.msi") set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) diff --git a/scripts/cmake/vcpkg_get_program_files_32_bit.cmake b/scripts/cmake/vcpkg_get_program_files_32_bit.cmake new file mode 100644 index 000000000..386e59c75 --- /dev/null +++ b/scripts/cmake/vcpkg_get_program_files_32_bit.cmake @@ -0,0 +1,7 @@ +function(vcpkg_get_program_files_32_bit ret) + if(DEFINED ENV{ProgramFiles\(X86\)}) + set(${ret} $ENV{ProgramFiles\(X86\)} PARENT_SCOPE) + else() + set(${ret} $ENV{PROGRAMFILES} PARENT_SCOPE) + endif() +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake b/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake new file mode 100644 index 000000000..44fba4d62 --- /dev/null +++ b/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake @@ -0,0 +1,7 @@ +function(vcpkg_get_program_files_platform_bitness ret) + if(DEFINED ENV{ProgramW6432}) + set(${ret} $ENV{ProgramW6432} PARENT_SCOPE) + else() + set(${ret} $ENV{PROGRAMFILES} PARENT_SCOPE) + endif() +endfunction() \ No newline at end of file -- cgit v1.2.3 From edec017ecec2e2a8ad57a0b5ee660b59a9479aac Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 19:20:13 -0800 Subject: Fix download of nasm. Resolves libjpeg-turbo build error --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 44e347e04..7e4f1ba9c 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -18,10 +18,10 @@ function(vcpkg_find_acquire_program VAR) set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) - set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.11.08) - set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.11.08/win32/nasm-2.11.08-win32.zip") - set(ARCHIVE "nasm-2.11.08-win32.zip") - set(HASH cd80b540530d3995d15dc636e97673f1d34f471baadf1dac993165232c61efefe7f8ec10625f8f718fc89f0dd3dcb6a4595e0cf40c5fd7cbac1b71672b644d2d) + set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02) + set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win32/nasm-2.12.02-win32.zip") + set(ARCHIVE "nasm-2.12.02-win32.zip") + set(HASH df7aaba094e17832688c88993997612a2e2c96cc3dc14ca3e8347b44c7762115f5a7fc6d7f20be402553aaa4c9e43ddfcf6228f581cfe89289bae550de151b36) elseif(VAR MATCHES "YASM") set(PROGNAME yasm) set(PATHS ${DOWNLOADS}/tools/yasm) -- cgit v1.2.3 From 03b65486536fc36889a9225fb8dc9de10f823ac6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 16:35:51 -0800 Subject: Use MinGit instead of PortableGit. Resolves #662 --- scripts/fetchDependency.ps1 | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 8d31b0edb..1faf5b165 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -113,8 +113,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) function Expand-ZIPFile($file, $destination) { - Write-Host($file) - Write-Host($destination) + if (!(Test-Path $destination)) + { + New-Item -ItemType Directory -Path $destination | Out-Null + } + $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) @@ -133,6 +136,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP + $extractionFolder = $downloadsDir } elseif($Dependency -eq "nuget") { @@ -147,14 +151,15 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) elseif($Dependency -eq "git") { $requiredVersion = "2.0.0" - $downloadVersion = "2.11.0" - $url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version - $downloadPath = "$downloadsDir\PortableGit-2.11.0.3-32-bit.7z.exe" - $expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01" - # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. + $downloadVersion = "2.11.1" + $url = "https://github.com/git-for-windows/git/releases/download/v2.11.1.windows.1/MinGit-2.11.1-32-bit.zip" # We choose the 32-bit version + $downloadPath = "$downloadsDir\MinGit-2.11.1-32-bit.zip" + $expectedDownloadedFileHash = "6ca79af09015625f350ef4ad74a75cfb001b340aec095b6963be9d45becb3bba" + # There is another copy of git.exe in MinGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. - $executableFromDownload = "$downloadsDir\PortableGit\cmd\git.exe" - $extractionType = $ExtractionType_SELF_EXTRACTING_7Z + $executableFromDownload = "$downloadsDir\MinGit-2.11.1-32-bit\cmd\git.exe" + $extractionType = $ExtractionType_ZIP + $extractionFolder = "$downloadsDir\MinGit-2.11.1-32-bit" } else { @@ -188,8 +193,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { if (-not (Test-Path $executableFromDownload)) # consider renaming the extraction folder to make sure the extraction finished { - # Expand-Archive $downloadPath -dest "$downloadsDir" -Force # Requires powershell 5+ - Expand-ZIPFile -File $downloadPath -Destination $downloadsDir + # Expand-Archive $downloadPath -dest "$extractionFolder" -Force # Requires powershell 5+ + Expand-ZIPFile -File $downloadPath -Destination $extractionFolder } } elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z) -- cgit v1.2.3 From 66cc4eed685f586cea4c36c1088632d6bf5feb9c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 18:02:16 -0800 Subject: CMake: Bump version to 3.8.0 to resolve VS2017 UWP build issues --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 1faf5b165..71f9e1089 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -129,12 +129,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.7.2" - $downloadVersion = "3.7.2" - $url = "https://cmake.org/files/v3.7/cmake-3.7.2-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.7.2-win32-x86.zip" - $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" - $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" + $requiredVersion = "3.8.0" + $downloadVersion = "3.8.0" + $url = "https://cmake.org/files/v3.8/cmake-3.8.0-rc1-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.8.0-rc1-win32-x86.zip" + $expectedDownloadedFileHash = "ccdbd92fbfb548aa35a545e4e45ff19fd6d13c88c90370acdf940c3cf464e9c9" + $executableFromDownload = "$downloadsDir\cmake-3.8.0-rc1-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP $extractionFolder = $downloadsDir } -- cgit v1.2.3 From 7b4cae57be4e42113b70fd755988623236a95bd7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 18:48:14 -0800 Subject: fetchDependency.ps1: add option to override prompting for download --- scripts/fetchDependency.ps1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 71f9e1089..6a40c9758 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -1,8 +1,14 @@ [CmdletBinding()] param( - [string]$Dependency + [string]$Dependency, + [ValidateNotNullOrEmpty()] + [string]$downloadPromptOverride = "0" ) +$downloadPromptOverride_NO_OVERRIDE= 0 +$downloadPromptOverride_DO_NOT_PROMPT = 1 +$downloadPromptOverride_ALWAYS_PROMPT = 2 + Import-Module BitsTransfer $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition @@ -12,9 +18,13 @@ $downloadsDir = "$vcpkgRootDir\downloads" function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { - function promptForDownload([string]$title, [string]$message, [string]$yesDescription, [string]$noDescription) + function promptForDownload([string]$title, [string]$message, [string]$yesDescription, [string]$noDescription, [string]$downloadPromptOverride) { - if ((Test-Path "$downloadsDir\AlwaysAllowEverything") -Or (Test-Path "$downloadsDir\AlwaysAllowDownloads")) + $do_not_prompt = ($downloadPromptOverride -eq $downloadPromptOverride_DO_NOT_PROMPT) -Or + (Test-Path "$downloadsDir\AlwaysAllowEverything") -Or + (Test-Path "$downloadsDir\AlwaysAllowDownloads") + + if (($downloadPromptOverride -ne $downloadPromptOverride_ALWAYS_PROMPT) -And $do_not_prompt) { return $true } @@ -57,7 +67,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $yesDescription = "Downloads " + $Dependency + " v" + $downloadVersion +" app-locally." $noDescription = "Does not download " + $Dependency + "." - $userAllowedDownload = promptForDownload $title $message $yesDescription $noDescription + $userAllowedDownload = promptForDownload $title $message $yesDescription $noDescription $downloadPromptOverride if (!$userAllowedDownload) { throw [System.IO.FileNotFoundException] ("Could not detect suitable version of " + $Dependency + " and download not allowed") -- cgit v1.2.3 From d36b292ae2b7bfb92d7c03d6aa44bb2a74311c36 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 19:13:10 -0800 Subject: Don't prompt for downloading nuget when finding VS instances This means bootstrap no longer prompts --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 9034ddfa8..8937c6fed 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -10,7 +10,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" -$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" +$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" 1 $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.5.125-rc" -- cgit v1.2.3 From cf537a2623efa6c892afce3301ffb98ad46a6b1e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 12 Feb 2017 22:18:09 -0800 Subject: [vcpkg] Use the Registry to find VS2015 --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 58 +++++++++++++++++------- 1 file changed, 42 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index d160aea12..15234a2f8 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -1,34 +1,60 @@ [CmdletBinding()] param( + [Parameter(Mandatory=$False)] + [switch]$DisableVS2017 = $False, + [Parameter(Mandatory=$False)] + [switch]$DisableVS2015 = $False ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -# VS2017 -$VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 -foreach ($instance in $VisualStudio2017InstallationInstances) +if (-not $DisableVS2017) { - $VCFolder= "$instance\VC\Tools\MSVC\" - - if (Test-Path $VCFolder) + # VS2017 + $VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 + foreach ($instance in $VisualStudio2017InstallationInstances) { - return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141" + $VCFolder= "$instance\VC\Tools\MSVC\" + + if (Test-Path $VCFolder) + { + return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141" + } } } -# VS2015 -$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1 -$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1 -$CandidateProgramFiles = $programFiles32, $programFilesP -foreach ($ProgramFiles in $CandidateProgramFiles) +if (-not $DisableVS2015) { - $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe" + # Try to locate VS2015 through the Registry + try + { + # First ensure the compiler was installed (optional in 2015) + # In 64-bit systems, this is under the Wow6432Node. + try + { + $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 - Found" + } + catch + { + $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 - Found" + } + if (!(Test-Path "${VS14InstallDir}..\..\VC\bin\cl.exe")) { throw } + Write-Verbose "${VS14InstallDir}..\..\VC\bin\cl.exe - Found" - if (Test-Path $clExe) + $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % MSBuildToolsPath) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found" + if (!(Test-Path "${MSBuild14}MSBuild.exe")) { throw } + Write-Verbose "${MSBuild14}MSBuild.exe - Found" + + return "${MSBuild14}MSBuild.exe","v140" + } + catch { - return "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe","v140" + Write-Verbose "Unable to locate a VS2015 installation with C++ support" } } -throw "Could not find MSBuild with C++ support. VS2015 or above with C++ support need to be installed." \ No newline at end of file +throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file -- cgit v1.2.3 From 0dbc59da7a582612171fbc7985f71470265062b9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 20:00:00 -0800 Subject: Fix script for powershell in Win7 --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 15234a2f8..72155b4f5 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -33,19 +33,28 @@ if (-not $DisableVS2015) # In 64-bit systems, this is under the Wow6432Node. try { - $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir) + $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % { $_.InstallDir }) Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 - Found" } catch { - $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir) + $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % { $_.InstallDir }) Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 - Found" } if (!(Test-Path "${VS14InstallDir}..\..\VC\bin\cl.exe")) { throw } Write-Verbose "${VS14InstallDir}..\..\VC\bin\cl.exe - Found" - $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % MSBuildToolsPath) - Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found" + + try + { + $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0 - Found" + } + catch + { + $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found" + } if (!(Test-Path "${MSBuild14}MSBuild.exe")) { throw } Write-Verbose "${MSBuild14}MSBuild.exe - Found" -- cgit v1.2.3 From 9aa7c944f21b8adec37b1da04145708ff621dcd7 Mon Sep 17 00:00:00 2001 From: pravic Date: Tue, 21 Feb 2017 08:24:14 +0300 Subject: Allow to use git.cmd in addition to git.exe In respect of #682 and https://cmake.org/Bug/bug_relationship_graph.php?bug_id=9879. --- scripts/cmake/vcpkg_apply_patches.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index e17d53b08..1ef138a1e 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -22,7 +22,7 @@ function(vcpkg_apply_patches) cmake_parse_arguments(_ap "QUIET" "SOURCE_PATH" "PATCHES" ${ARGN}) - find_program(GIT git) + find_program(GIT NAMES git git.cmd) set(PATCHNUM 0) foreach(PATCH ${_ap_PATCHES}) message(STATUS "Applying patch ${PATCH}") -- cgit v1.2.3