Skip to content

Commit

Permalink
Add CI job to test iOS cross-compilation
Browse files Browse the repository at this point in the history
A build job with IMATH_BUILD_APPLE_FRAMEWORKS=ON. This can't run the
tests, but it can confirm it builds and validate the install.

Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Jan 20, 2025
1 parent e4fe355 commit db08aae
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/ci_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ on:
type: string
BUILD_TESTING:
type: string
IMATH_BUILD_APPLE_FRAMEWORKS:
type: string
namespace:
type: string
validate_install:
Expand All @@ -62,6 +64,10 @@ jobs:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Select Xcode Version
if: runner.os == 'macOS'
run: sudo xcode-select --switch /Applications/Xcode_15.2.app

- name: Create build directories
run: mkdir _install _build _examples
shell: bash
Expand All @@ -77,13 +83,17 @@ jobs:
-DCMAKE_CXX_STANDARD=${{ inputs.cxx-standard }} \
-DBUILD_SHARED_LIBS=${{ inputs.BUILD_SHARED_LIBS }} \
-DIMATH_INSTALL_PKG_CONFIG=${{ inputs.IMATH_INSTALL_PKG_CONFIG }} \
-DIMATH_BUILD_APPLE_FRAMEWORKS=${{ inputs.IMATH_BUILD_APPLE_FRAMEWORKS }} \
-DBUILD_TESTING=${{ inputs.BUILD_TESTING }} \
-DPYTHON=${{ inputs.python }} \
-DPYBIND11=${{ inputs.pybind11 }} \
-DCMAKE_VERBOSE_MAKEFILE=ON"
if [ -n "${{ inputs.namespace }}" ]; then
CMAKE_COMMAND="$CMAKE_COMMAND -DIMATH_NAMESPACE=${{ inputs.namespace }}"
fi
if [ "${{ inputs.IMATH_BUILD_APPLE_FRAMEWORKS }}" == "ON" ]; then
CMAKE_COMMAND="$CMAKE_COMMAND -DCMAKE_SYSTEM_NAME=iOS"
fi
echo "CMAKE_COMMAND=$CMAKE_COMMAND" >> $GITHUB_ENV
# Remove the os version from the manifest name, so it only
Expand Down Expand Up @@ -159,7 +169,7 @@ jobs:

- name: Examples
# The example code use the Imath:: namespace explicitly, they won't work with a custom namespace, so skip the test in that case.
if: ${{ inputs.namespace == '' }}
if: ${{ inputs.namespace == '' && inputs.IMATH_BUILD_APPLE_FRAMEWORKS != 'ON' }}
run: |
# Confirm the examples compile and execute
rm -rf bin CMakeCache.txt CMakeFiles cmake_install.cmake Makefile
Expand Down Expand Up @@ -197,6 +207,7 @@ jobs:
working-directory: _build

- name: Test
if: ${{ inputs.IMATH_BUILD_APPLE_FRAMEWORKS != 'ON' }}
run: |
ctest -T Test -C ${{ inputs.build-type }} --timeout 7200 --output-on-failure -VV
working-directory: _build
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:
pybind11: ${{ matrix.pybind11 || 'OFF' }}
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS || 'ON' }}
IMATH_INSTALL_PKG_CONFIG: ${{ matrix.IMATH_INSTALL_PKG_CONFIG || 'ON' }}
IMATH_BUILD_APPLE_FRAMEWORKS: ${{ matrix.IMATH_BUILD_APPLE_FRAMEWORKS || 'OFF' }}
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
validate_install: ${{ matrix.validate_install || 'ON' }}
strategy:
Expand All @@ -136,6 +137,10 @@ jobs:
label: macos-13
os: macos-13

- build: 6
label: apple frameworks
IMATH_BUILD_APPLE_FRAMEWORKS: 'ON'

windows:
name: 'Windows.${{ matrix.build}}: ${{ matrix.label }}'
uses: ./.github/workflows/ci_steps.yml
Expand Down
44 changes: 44 additions & 0 deletions share/ci/install_manifest/install_manifest.macos.6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# cmake -B . -S .. -DCMAKE_INSTALL_PREFIX=../_install -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON -DIMATH_INSTALL_PKG_CONFIG=ON -DIMATH_BUILD_APPLE_FRAMEWORKS=ON -DBUILD_TESTING=ON -DPYTHON=OFF -DPYBIND11=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_SYSTEM_NAME=iOS
include/Imath/ImathConfig.h
lib/cmake/Imath/ImathConfig.cmake
lib/cmake/Imath/ImathConfigVersion.cmake
lib/cmake/Imath/ImathTargets-release.cmake
lib/cmake/Imath/ImathTargets.cmake
lib/imath.framework/Headers/ImathBox.h
lib/imath.framework/Headers/ImathBoxAlgo.h
lib/imath.framework/Headers/ImathColor.h
lib/imath.framework/Headers/ImathColorAlgo.h
lib/imath.framework/Headers/ImathEuler.h
lib/imath.framework/Headers/ImathExport.h
lib/imath.framework/Headers/ImathForward.h
lib/imath.framework/Headers/ImathFrame.h
lib/imath.framework/Headers/ImathFrustum.h
lib/imath.framework/Headers/ImathFrustumTest.h
lib/imath.framework/Headers/ImathFun.h
lib/imath.framework/Headers/ImathGL.h
lib/imath.framework/Headers/ImathGLU.h
lib/imath.framework/Headers/ImathInt64.h
lib/imath.framework/Headers/ImathInterval.h
lib/imath.framework/Headers/ImathLine.h
lib/imath.framework/Headers/ImathLineAlgo.h
lib/imath.framework/Headers/ImathMath.h
lib/imath.framework/Headers/ImathMatrix.h
lib/imath.framework/Headers/ImathMatrixAlgo.h
lib/imath.framework/Headers/ImathNamespace.h
lib/imath.framework/Headers/ImathPlane.h
lib/imath.framework/Headers/ImathPlatform.h
lib/imath.framework/Headers/ImathQuat.h
lib/imath.framework/Headers/ImathRandom.h
lib/imath.framework/Headers/ImathRoots.h
lib/imath.framework/Headers/ImathShear.h
lib/imath.framework/Headers/ImathSphere.h
lib/imath.framework/Headers/ImathTypeTraits.h
lib/imath.framework/Headers/ImathVec.h
lib/imath.framework/Headers/ImathVecAlgo.h
lib/imath.framework/Headers/half.h
lib/imath.framework/Headers/halfFunction.h
lib/imath.framework/Headers/halfLimits.h
lib/imath.framework/Info.plist
lib/imath.framework/imath
lib/libImath.dylib
lib/pkgconfig/Imath.pc

0 comments on commit db08aae

Please sign in to comment.