From d614e3e887eb0ef5c47f1c7ba7a9189c8fc0f011 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Aug 2018 10:51:33 -0700 Subject: [PATCH] [openssl-unix] Fix for issue #4001 [vcpkg_configure_cmake] Use the correct path separators for the current platform instead of assuming ; --- ports/openssl-unix/CMakeLists.txt | 6 +++++- ports/openssl-unix/CONTROL | 2 +- scripts/cmake/vcpkg_acquire_msys.cmake | 4 ++++ scripts/cmake/vcpkg_build_cmake.cmake | 11 ++++++++--- scripts/cmake/vcpkg_configure_cmake.cmake | 10 ++++++++-- scripts/cmake/vcpkg_configure_meson.cmake | 7 ++++++- 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ports/openssl-unix/CMakeLists.txt b/ports/openssl-unix/CMakeLists.txt index f9c6e7e7cc..fd59645067 100644 --- a/ports/openssl-unix/CMakeLists.txt +++ b/ports/openssl-unix/CMakeLists.txt @@ -47,7 +47,11 @@ endif() string(REGEX REPLACE "^ " "" CFLAGS "${CFLAGS}") -file(TO_NATIVE_PATH ENV_PATH "${COMPILER_ROOT};$ENV{PATH}") +if(CMAKE_HOST_WIN32) + file(TO_NATIVE_PATH ENV_PATH "${COMPILER_ROOT};$ENV{PATH}") +else() + file(TO_NATIVE_PATH ENV_PATH "${COMPILER_ROOT}:$ENV{PATH}") +endif() set(ENV{ANDROID_DEV} "${CMAKE_SYSROOT}/usr") set(ENV{CC} "${CMAKE_C_COMPILER}") diff --git a/ports/openssl-unix/CONTROL b/ports/openssl-unix/CONTROL index fb2909becc..db47c018bb 100644 --- a/ports/openssl-unix/CONTROL +++ b/ports/openssl-unix/CONTROL @@ -1,3 +1,3 @@ Source: openssl-unix -Version: 1.0.2o +Version: 1.0.2o-1 Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index eec08e3f1e..ed4f7ac294 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -39,6 +39,10 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(TOOLPATH ${DOWNLOADS}/tools/msys2) cmake_parse_arguments(_am "" "" "PACKAGES" ${ARGN}) + if(NOT CMAKE_HOST_WIN32) + message(FATAL_ERROR "vcpkg_acquire_msys() can only be used on Windows hosts") + endif() + # detect host architecture if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) set(_vam_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITEW6432}) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 9aafb0d4b8..2f0da07f96 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -80,10 +80,15 @@ function(vcpkg_build_cmake) if(_bc_ADD_BIN_TO_PATH) set(_BACKUP_ENV_PATH "$ENV{PATH}") - if(BUILDTYPE STREQUAL "debug") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin;$ENV{PATH}") + if(CMAKE_HOST_WIN32) + set(_PATHSEP ";") else() - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin;$ENV{PATH}") + set(_PATHSEP ":") + endif() + if(BUILDTYPE STREQUAL "debug") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin${_PATHSEP}$ENV{PATH}") + else() + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin${_PATHSEP}$ENV{PATH}") endif() endif() execute_process( diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 81a30d4bb7..e89ac660ee 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -62,6 +62,12 @@ function(vcpkg_configure_cmake) set(_csc_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITECTURE}) endif() + if(CMAKE_HOST_WIN32) + set(_PATHSEP ";") + else() + set(_PATHSEP ":") + endif() + set(NINJA_CAN_BE_USED ON) # Ninja as generator set(NINJA_HOST ON) # Ninja as parallel configurator if(_csc_HOST_ARCHITECTURE STREQUAL "x86") @@ -114,7 +120,7 @@ function(vcpkg_configure_cmake) if(GENERATOR STREQUAL "Ninja") vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) - set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") + set(ENV{PATH} "$ENV{PATH}${_PATHSEP}${NINJA_PATH}") list(APPEND _csc_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") endif() @@ -210,7 +216,7 @@ function(vcpkg_configure_cmake) vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) - set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") + set(ENV{PATH} "$ENV{PATH}${_PATHSEP}${NINJA_PATH}") #parallelize the configure step set(_contents diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index 9b87261d5b..3c6903c9db 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -39,7 +39,12 @@ function(vcpkg_configure_meson) vcpkg_find_acquire_program(MESON) vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) - set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") + if(CMAKE_HOST_WIN32) + set(_PATHSEP ";") + else() + set(_PATHSEP ":") + endif() + set(ENV{PATH} "$ENV{PATH}${_PATHSEP}${NINJA_PATH}") # configure release if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")