Skip to content

Commit

Permalink
[openssl-unix] Fix for issue microsoft#4001
Browse files Browse the repository at this point in the history
[vcpkg_configure_cmake] Use the correct path separators for the current platform instead of assuming ;
  • Loading branch information
ras0219-msft authored and Kwizatz committed Aug 26, 2018
1 parent 3792702 commit 401d4f6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
6 changes: 5 additions & 1 deletion ports/openssl-unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
2 changes: 1 addition & 1 deletion ports/openssl-unix/CONTROL
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 4 additions & 0 deletions scripts/cmake/vcpkg_acquire_msys.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
9 changes: 7 additions & 2 deletions scripts/cmake/vcpkg_build_cmake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ function(vcpkg_build_cmake)

if(_bc_ADD_BIN_TO_PATH)
set(_BACKUP_ENV_PATH "$ENV{PATH}")
if(CMAKE_HOST_WIN32)
set(_PATHSEP ";")
else()
set(_PATHSEP ":")
endif()
if(BUILDTYPE STREQUAL "debug")
set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin;$ENV{PATH}")
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;$ENV{PATH}")
set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin${_PATHSEP}$ENV{PATH}")
endif()
endif()
execute_process(
Expand Down
10 changes: 8 additions & 2 deletions scripts/cmake/vcpkg_configure_cmake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion scripts/cmake/vcpkg_configure_meson.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 401d4f6

Please sign in to comment.