diff --git a/ports/openssl-unix/CMakeLists.txt b/ports/openssl-unix/CMakeLists.txt index a763a874913945..7e09222c92e2e0 100644 --- a/ports/openssl-unix/CMakeLists.txt +++ b/ports/openssl-unix/CMakeLists.txt @@ -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") @@ -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) @@ -118,6 +131,8 @@ else() set(PATH_VAR ":$ENV{PATH}") endif() + + add_custom_command( OUTPUT "${BUILDDIR}/Makefile" COMMAND ${ENV_COMMAND} CC=${CMAKE_C_COMPILER} @@ -138,6 +153,7 @@ add_custom_command( no-seed no-md2 no-tests + ${DISABLES} ${PLATFORM} "--prefix=${CMAKE_INSTALL_PREFIX}" "--openssldir=/etc/ssl" diff --git a/ports/openssl-unix/CONTROL b/ports/openssl-unix/CONTROL index 9ea5cc309d6e5a..9c28728ff7b24e 100644 --- a/ports/openssl-unix/CONTROL +++ b/ports/openssl-unix/CONTROL @@ -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)