Skip to content

Commit aa8d831

Browse files
committed
Fixup iOS builds
1 parent 5eda470 commit aa8d831

File tree

6 files changed

+1220
-30
lines changed

6 files changed

+1220
-30
lines changed

.github/workflows/apple.yml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
config:
40-
- {name: "macOS-latest", os: "macOS-latest", cmake_extra: "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=\"x86_64;arm64\" -DLSL_FRAMEWORK=ON" }
41-
- {name: "iOS", os: "macOS-latest", cmake_extra: "-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_OSX_ARCHITECTURES=\"arm64;x86_64\" -DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake -DLSL_FRAMEWORK=ON" }
40+
- {name: "macOS-latest", os: "macOS-latest", cmake_extra: "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DLSL_UNITTESTS=ON -DLSL_BENCHMARKS=ON" }
41+
- {name: "iOS", os: "macOS-latest", cmake_extra: "-DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake -DPLATFORM=OS64" }
4242

4343
steps:
4444
- uses: actions/checkout@v4
@@ -59,9 +59,9 @@ jobs:
5959
cmake -S . -B build \
6060
-DCMAKE_BUILD_TYPE=Release \
6161
-DCMAKE_INSTALL_PREFIX=${PWD}/install \
62-
-DLSL_UNITTESTS=ON \
63-
-DLSL_BENCHMARKS=ON \
6462
-DCPACK_PACKAGE_DIRECTORY=${PWD}/package \
63+
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
64+
-DLSL_FRAMEWORK=ON \
6565
-Dlslgitrevision=${{ github.sha }} \
6666
-Dlslgitbranch=${{ github.ref }} \
6767
${{ matrix.config.cmake_extra }} \
@@ -89,15 +89,25 @@ jobs:
8989
9090
- name: Codesign
9191
run: |
92-
codesign -vvv --force --deep --sign "$APPLE_CODE_SIGN_IDENTITY_APP" \
93-
--entitlements lsl.entitlements --options runtime \
94-
install/Frameworks/lsl.framework/Versions/A/lsl
95-
codesign -vvv --force --deep --sign "$APPLE_CODE_SIGN_IDENTITY_APP" \
96-
--entitlements lsl.entitlements --options runtime \
97-
install/Frameworks/lsl.framework
98-
echo "✅ Verifying binary signatures in install target..."
99-
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework/Versions/A/lsl
100-
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework
92+
if [[ "${{ matrix.config.name }}" == "macOS-latest" ]]; then
93+
codesign -vvv --force --deep --sign "$APPLE_CODE_SIGN_IDENTITY_APP" \
94+
--entitlements lsl.entitlements --options runtime \
95+
install/Frameworks/lsl.framework/Versions/A/lsl
96+
codesign -vvv --force --deep --sign "$APPLE_CODE_SIGN_IDENTITY_APP" \
97+
--entitlements lsl.entitlements --options runtime \
98+
install/Frameworks/lsl.framework
99+
echo "✅ Verifying binary signatures in install target..."
100+
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework/Versions/A/lsl
101+
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework
102+
elif [[ "${{ matrix.config.name }}" == "iOS" ]]; then
103+
codesign -vvv --force --deep --sign "$APPLE_CODE_SIGN_IDENTITY_APP" \
104+
install/Frameworks/lsl.framework/lsl
105+
codesign -vvv --force --deep --sign "$APPLE_CODE_SIGN_IDENTITY_APP" \
106+
install/Frameworks/lsl.framework
107+
echo "✅ Verifying binary signatures in install target..."
108+
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework/lsl
109+
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework
110+
fi
101111
102112
- name: upload install dir
103113
uses: actions/upload-artifact@v4
@@ -126,6 +136,7 @@ jobs:
126136
needs: build
127137
runs-on: macOS-latest
128138
steps:
139+
- uses: actions/checkout@v4
129140
- uses: actions/download-artifact@v4
130141
with:
131142
name: build-macOS-latest
@@ -183,13 +194,6 @@ jobs:
183194
184195
ditto -c -k --sequesterRsrc --keepParent lsl.xcframework lsl.xcframework.zip
185196
186-
xcrun notarytool submit lsl.xcframework.zip \
187-
--apple-id "$APPLE_NOTARIZE_USERNAME" \
188-
--password "$APPLE_NOTARIZE_PASSWORD" \
189-
--team-id "$APPLE_DEVELOPMENT_TEAM" \
190-
--wait
191-
xcrun stapler staple lsl.xcframework
192-
193197
- name: upload artifacts
194198
uses: actions/upload-artifact@v4
195199
with:
@@ -210,4 +214,4 @@ jobs:
210214
NAME=$(basename $pkg)
211215
MIME=$(file --mime-type $pkg|cut -d ' ' -f2)
212216
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: $TOKEN" -H "Content-Type: $MIME" --data-binary @$pkg $UPLOAD_URL?name=$NAME
213-
done
217+
done

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include(cmake/TargetLib.cmake) #
1919
include(cmake/Installation.cmake) #
2020
include(cmake/TargetOther.cmake)
2121

22-
if(LSL_UNITTESTS)
22+
if(LSL_UNITTESTS AND NOT IOS)
2323
add_subdirectory(testing)
2424
endif()
2525

cmake/Installation.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ endif()
1515
# For Apple frameworks, we need to next the install directories within the framework.
1616
if(APPLE AND LSL_FRAMEWORK)
1717
# For the includes, this is insufficient. Later we will create more accessible symlinks.
18-
set(LSL_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_FRAMEWORK_DIR}/lsl.framework/Versions/A/include)
19-
set(LSL_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_FRAMEWORK_DIR}/lsl.framework/Resources/CMake)
18+
if(IOS)
19+
set(LSL_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_FRAMEWORK_DIR}/lsl.framework/Headers)
20+
set(LSL_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_FRAMEWORK_DIR}/lsl.framework/CMake)
21+
else()
22+
set(LSL_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_FRAMEWORK_DIR}/lsl.framework/Versions/A/include)
23+
set(LSL_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_FRAMEWORK_DIR}/lsl.framework/Resources/CMake)
24+
endif()
25+
2026
else()
2127
set(LSL_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
2228
set(LSL_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/lsl)
@@ -73,7 +79,7 @@ install(
7379
DESTINATION ${LSL_CONFIG_INSTALL_DIR}
7480
)
7581

76-
if(APPLE AND LSL_FRAMEWORK)
82+
if(APPLE AND LSL_FRAMEWORK AND NOT IOS)
7783
# Create symlinks for the framework. The variables we want to use to identify the symlink locations
7884
# are not available at install time. Instead, we create a script during configuration time that will
7985
# be run at install time to create the symlinks.

cmake/TargetLib.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if(APPLE)
7878
if(LSL_FRAMEWORK)
7979
set_target_properties(lsl PROPERTIES
8080
FRAMEWORK TRUE
81-
FRAMEWORK_VERSION A
81+
FRAMEWORK_VERSION A # Ignored on iOS
8282
MACOSX_FRAMEWORK_IDENTIFIER "org.labstreaminglayer.liblsl"
8383
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${liblsl_VERSION_MAJOR}.${liblsl_VERSION_MINOR}"
8484
MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}

cmake/TargetOther.cmake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
include(cmake/LSLCMake.cmake) # Needed for `installLSLApp`
1+
include(cmake/LSLCMake.cmake) # Needed for `installLSLApp` and `LSLGenerateCPackConfig`
22

3-
# Build utilities
3+
# Build utilities
44
add_executable(lslver testing/lslver.c)
55
target_link_libraries(lslver PRIVATE lsl)
6+
if(NOT IOS)
67
installLSLApp(lslver)
7-
8+
endif(NOT IOS)
89
if(NOT WIN32 AND LSL_TOOLS)
910
add_executable(blackhole testing/blackhole.cpp)
1011
target_link_libraries(blackhole PRIVATE Threads::Threads)
1112
target_include_directories(blackhole PRIVATE "thirdparty/asio/")
12-
installLSLApp(blackhole)
13+
if(NOT IOS)
14+
installLSLApp(blackhole)
15+
endif(NOT IOS)
1316
endif()

0 commit comments

Comments
 (0)