mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
iOS Updates
Some minor refactoring for iOS: - Roll back clar changes; these should be a bit more measured, and occur in clar upstream. - Move iOS to nightly builds
This commit is contained in:
13
.github/workflows/main.yml
vendored
13
.github/workflows/main.yml
vendored
@@ -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
|
||||
|
||||
10
.github/workflows/nightly.yml
vendored
10
.github/workflows/nightly.yml
vendored
@@ -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
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
brew update
|
||||
brew install hyperfine
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -10,15 +10,6 @@ int __cdecl main(int argc, char *argv[])
|
||||
#else
|
||||
int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <TargetConditionals.h>
|
||||
#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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user