diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b42a5c992..87e834f10 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,19 +73,6 @@ jobs: PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig SKIP_SSH_TESTS: true SKIP_NEGOTIATE_TESTS: true - - name: "iOS" - id: ios - os: macos-12 - setup-script: ios - env: - CC: clang - CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake -DCMAKE_SYSTEM_NAME=iOS -DPLATFORM=OS64 - CMAKE_GENERATOR: Ninja - PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig - # Skip all tests on iOS temporarily. - # 1. We need to update the path from libgit2_tests to libgit2_tests.app/libgit2_tests - # 2. We need to find a way to specify an iOS device / iOS simulator to run the tests. - SKIP_TESTS: true - name: "Windows (amd64, Visual Studio, Schannel)" id: windows-amd64-vs os: windows-2019 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 28a06189d..f66febbfd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -74,6 +74,16 @@ jobs: PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig SKIP_SSH_TESTS: true SKIP_NEGOTIATE_TESTS: true + - name: "iOS" + id: ios + os: macos-12 + setup-script: ios + env: + CC: clang + CMAKE_OPTIONS: -DBUILD_TESTS=OFF -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake -DCMAKE_SYSTEM_NAME=iOS -DPLATFORM=OS64 + CMAKE_GENERATOR: Ninja + PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig + SKIP_TESTS: true # Cannot exec iOS app on macOS - name: "Windows (amd64, Visual Studio, Schannel)" id: windows-amd64-vs os: windows-2019 diff --git a/ci/setup-ios-benchmark.sh b/ci/setup-ios-benchmark.sh deleted file mode 100755 index 80d87682b..000000000 --- a/ci/setup-ios-benchmark.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -ex - -brew update -brew install hyperfine diff --git a/ci/setup-ios-build.sh b/ci/setup-ios-build.sh index 195106c51..94af4e486 100755 --- a/ci/setup-ios-build.sh +++ b/ci/setup-ios-build.sh @@ -7,6 +7,4 @@ brew install pkgconfig libssh2 ninja ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libLeaksAtExit.dylib /usr/local/lib -# The above is copied from setup-osx-build.sh - curl -s -L https://raw.githubusercontent.com/leetal/ios-cmake/master/ios.toolchain.cmake -o ios.toolchain.cmake diff --git a/cmake/SelectRegex.cmake b/cmake/SelectRegex.cmake index 0e34b7330..840ec7f34 100644 --- a/cmake/SelectRegex.cmake +++ b/cmake/SelectRegex.cmake @@ -5,12 +5,8 @@ if(REGEX_BACKEND STREQUAL "") check_symbol_exists(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L) if(HAVE_REGCOMP_L) + # 'regcomp_l' has been explicitly marked unavailable on iOS_SDK if(CMAKE_SYSTEM_NAME MATCHES "iOS") - # 'regcomp_l' has been explicitly marked unavailable on iOS_SDK - # /usr/include/xlocale/_regex.h:34:5: - # int regcomp_l(regex_t * __restrict, const char * __restrict, int, - # locale_t __restrict) - # __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA); set(REGEX_BACKEND "regcomp") else() set(REGEX_BACKEND "regcomp_l") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2517df22f..73c46e210 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -128,13 +128,7 @@ endif() check_library_exists(rt clock_gettime "time.h" NEED_LIBRT) -# workaround the iOS issue where clock_gettime is provided -# But we can't find rt library for some reason -if(CMAKE_SYSTEM_NAME MATCHES "iOS") - set(NEED_LIBRT FALSE) -endif() - -if(NEED_LIBRT) +if(NEED_LIBRT AND NOT CMAKE_SYSTEM_NAME MATCHES "iOS") list(APPEND LIBGIT2_SYSTEM_LIBS rt) list(APPEND LIBGIT2_PC_LIBS "-lrt") endif() diff --git a/tests/clar/main.c b/tests/clar/main.c index 0a3ca354d..e3f4fe740 100644 --- a/tests/clar/main.c +++ b/tests/clar/main.c @@ -10,15 +10,6 @@ int __cdecl main(int argc, char *argv[]) #else int main(int argc, char *argv[]) #endif - -#if defined(__APPLE__) -#include -#else -#if !defined(TARGET_OS_IOS) -#define TARGET_OS_IOS 0 -#endif -#endif - { int res; char *at_exit_cmd; @@ -53,13 +44,9 @@ int main(int argc, char *argv[]) at_exit_cmd = getenv("CLAR_AT_EXIT"); if (at_exit_cmd != NULL) { - #if TARGET_OS_IOS - /* system is unavailable on iOS */ - return res; - #else int at_exit = system(at_exit_cmd); return res || at_exit; - #endif } + return res; }