Skip to content

Commit

Permalink
[openssl-unix] use xcrun for iOS triplet build (#12527)
Browse files Browse the repository at this point in the history
* [openssl] use xcrun for iOS triplet build

* config for iOS simulator architecture
* use .dylib suffix for iOS shared is used

* [openssl-unix] increase port version in CONTROL

* Update CONTROL

* [openssl-unix] update port version

* prevent collision with #12544

* [openssl-unix] make disable platform specific

* [openssl-unix] replace set to list(APPEND)

Co-authored-by: Lily <[email protected]>
  • Loading branch information
luncliff and LilyWangL authored Aug 25, 2020
1 parent 1f52fba commit 6ed0bc9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion ports/openssl-unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
else()
set(PLATFORM linux-generic32)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")
set(PLATFORM ios64-xcrun)
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm")
set(PLATFORM ios-xcrun)
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" OR
VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
set(PLATFORM iossimulator-xcrun)
else()
message(FATAL_ERROR "Unknown iOS target architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
# disable that makes linkage error (e.g. require stderr usage)
list(APPEND DISABLES no-stdio no-ui no-asm)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(PLATFORM darwin64-x86_64-cc)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
Expand Down Expand Up @@ -79,7 +92,7 @@ if(BUILD_SHARED_LIBS)
REGEX "^#[\t ]*define[\t ]+SHLIB_VERSION_NUMBER[\t ]+\".*\".*")
string(REGEX REPLACE "^.*SHLIB_VERSION_NUMBER[\t ]+\"([^\"]*)\".*$" "\\1"
SHLIB_VERSION "${SHLIB_VERSION}")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(LIB_EXT dylib)
set(LIB_EXTS ${SHLIB_VERSION}.${LIB_EXT})
elseif(MINGW)
Expand Down Expand Up @@ -118,6 +131,8 @@ else()
set(PATH_VAR ":$ENV{PATH}")
endif()



add_custom_command(
OUTPUT "${BUILDDIR}/Makefile"
COMMAND ${ENV_COMMAND} CC=${CMAKE_C_COMPILER}
Expand All @@ -138,6 +153,7 @@ add_custom_command(
no-seed
no-md2
no-tests
${DISABLES}
${PLATFORM}
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--openssldir=/etc/ssl"
Expand Down
2 changes: 1 addition & 1 deletion ports/openssl-unix/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: openssl-unix
Version: 1.1.1g
Port-Version: 3
Port-Version: 4
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.
Supports: !(windows|uwp)

0 comments on commit 6ed0bc9

Please sign in to comment.