4545 type : string
4646 BUILD_TESTING :
4747 type : string
48- IMATH_BUILD_APPLE_FRAMEWORKS :
48+ IMATH_BUILD_APPLE_FRAMEWORK :
49+ type : string
50+ CMAKE_OSX_SYSROOT :
51+ type : string
52+ CMAKE_OSX_ARCHITECTURES :
53+ type : string
54+ CMAKE_SYSTEM_NAME :
4955 type : string
5056 IMATH_TEST_PYTHON :
5157 type : string
@@ -252,7 +258,7 @@ jobs:
252258 cmake_args+=("-DBUILD_SHARED_LIBS=${{ inputs.BUILD_SHARED_LIBS }}")
253259 cmake_args+=("-DIMATH_INSTALL_PKG_CONFIG=${{ inputs.IMATH_INSTALL_PKG_CONFIG }}")
254260 cmake_args+=("-DIMATH_INSTALL_SYM_LINK=${{ inputs.IMATH_INSTALL_SYM_LINK }}")
255- cmake_args+=("-DIMATH_BUILD_APPLE_FRAMEWORKS =${{ inputs.IMATH_BUILD_APPLE_FRAMEWORKS }}")
261+ cmake_args+=("-DIMATH_BUILD_APPLE_FRAMEWORK =${{ inputs.IMATH_BUILD_APPLE_FRAMEWORK }}")
256262 cmake_args+=("-DBUILD_TESTING=${{ inputs.BUILD_TESTING }}")
257263 cmake_args+=("-DPYTHON=${{ inputs.python }}")
258264 cmake_args+=("-DPYBIND11=${{ inputs.pybind11 }}")
@@ -289,8 +295,14 @@ jobs:
289295 cmake_args+=("-DPYIMATH_LIB_SUFFIX=PY_${{ inputs.namespace }}")
290296 cmake_args+=("-DPYBINDIMATH_LIB_SUFFIX=PYBIND_${{ inputs.namespace }}")
291297 fi
292- if [ "${{ inputs.IMATH_BUILD_APPLE_FRAMEWORKS }}" == "ON" ]; then
293- cmake_args+=("-DCMAKE_SYSTEM_NAME=iOS")
298+ if [ -n "${{ inputs.CMAKE_SYSTEM_NAME }}" ]; then
299+ cmake_args+=("-DCMAKE_SYSTEM_NAME=${{ inputs.CMAKE_SYSTEM_NAME }}")
300+ fi
301+ if [ -n "${{ inputs.CMAKE_OSX_SYSROOT }}" ]; then
302+ cmake_args+=("-DCMAKE_OSX_SYSROOT=${{ inputs.CMAKE_OSX_SYSROOT }}")
303+ fi
304+ if [ -n "${{ inputs.CMAKE_OSX_ARCHITECTURES }}" ]; then
305+ cmake_args+=("-DCMAKE_OSX_ARCHITECTURES=${{ inputs.CMAKE_OSX_ARCHITECTURES }}")
294306 fi
295307
296308 quoted_args=$(printf '%q ' "${cmake_args[@]}")
@@ -308,6 +320,7 @@ jobs:
308320 run : |
309321 set -x
310322 $CMAKE --version
323+ echo $CMAKE ${{ env.CMAKE_ARGS }}
311324 $CMAKE ${{ env.CMAKE_ARGS }}
312325 $CMAKE --build $BUILD_DIR --target install --config ${{ inputs.build-type }}
313326 shell : bash
@@ -323,7 +336,7 @@ jobs:
323336 shell : msys2 {0}
324337
325338 - name : Validate library symlinks
326- if : inputs.BUILD_SHARED_LIBS == 'ON' && inputs.IMATH_BUILD_APPLE_FRAMEWORKS != 'ON' && inputs.IMATH_INSTALL_SYM_LINK == 'ON'
339+ if : inputs.BUILD_SHARED_LIBS == 'ON' && inputs.IMATH_BUILD_APPLE_FRAMEWORK != 'ON' && inputs.IMATH_INSTALL_SYM_LINK == 'ON'
327340 # Validate that the proper symlinks have been created
328341 # between the various versions of the .so/.dylib/.dll,
329342 # especially the one created explicitly (based on the
@@ -470,7 +483,7 @@ jobs:
470483 shell : bash
471484
472485 - name : Test ImathTest Standalone
473- if : inputs.msystem == '' && inputs.IMATH_BUILD_APPLE_FRAMEWORKS != 'ON'
486+ if : inputs.msystem == '' && inputs.IMATH_BUILD_APPLE_FRAMEWORK != 'ON'
474487 # Use the ImathTest program as an example of an application
475488 # using the Imath library, to validate that we can build
476489 # against the just-installed Imath library
@@ -510,33 +523,8 @@ jobs:
510523 fi
511524 shell : bash
512525
513- - name : Test ImathTest Standalone (iOS)
514- if : inputs.msystem == '' && inputs.IMATH_BUILD_APPLE_FRAMEWORKS == 'ON'
515- # Use the ImathTest program as an example of an application
516- # using the Imath library, to validate that we can build
517- # against the just-installed Imath library
518- run : |
519- set -x
520-
521- IMATHTEST_BUILD_DIR=$WORKSPACE/_build.imathTest.iOS
522- cmake_args=("-B" "$IMATHTEST_BUILD_DIR" "-S" "$WORKSPACE/src/ImathTest")
523- cmake_args+=("-DImath_DIR=$INSTALL_DIR/lib/Imath.framework/Resources")
524- cmake_args+=("-DCMAKE_BUILD_TYPE=${{ inputs.build-type }}")
525- cmake_args+=("-DCMAKE_CXX_STANDARD=${{ inputs.cxx-standard }}")
526- cmake_args+=("-DCMAKE_CXX_FLAGS=${{ inputs.cxx-flags }}")
527- cmake_args+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
528- cmake_args+=("-DCMAKE_SYSTEM_NAME=iOS")
529- cmake_args+=("-DCMAKE_OSX_SYSROOT=iphoneos")
530- cmake_args+=("-DCMAKE_OSX_ARCHITECTURES=arm64")
531- quoted_args=$(printf '%q ' "${cmake_args[@]}")
532- $CMAKE $quoted_args
533- $CMAKE --build $IMATHTEST_BUILD_DIR \
534- --config ${{ inputs.build-type }}
535- otool -L $IMATHTEST_BUILD_DIR/bin/ImathTest.app/ImathTest
536- shell : bash
537-
538526 - name : Test PyImathTest Standalone
539- if : inputs.msystem == '' && inputs.PYTHON == 'ON' && inputs.IMATH_TEST_PYTHON == 'ON' && inputs.IMATH_BUILD_APPLE_FRAMEWORKS != 'ON'
527+ if : inputs.msystem == '' && inputs.PYTHON == 'ON' && inputs.IMATH_TEST_PYTHON == 'ON' && inputs.IMATH_BUILD_APPLE_FRAMEWORK != 'ON'
540528 # Use the PyImathTestC program as an example of an application
541529 # that uses the PyImath library, to validate that we can build
542530 # against the just-installed Imath library (with python
@@ -573,7 +561,7 @@ jobs:
573561 shell : bash
574562
575563 - name : Examples
576- if : inputs.namespace == '' && inputs.msystem == '' && inputs.IMATH_BUILD_APPLE_FRAMEWORKS != 'ON'
564+ if : inputs.namespace == '' && inputs.msystem == '' && inputs.IMATH_BUILD_APPLE_FRAMEWORK != 'ON'
577565 # Confirm the website examples compile and execute.
578566 # The example code uses the Imath:: namespace explicitly, so
579567 # they won't work with a custom namespace, so skip the test in
@@ -633,4 +621,26 @@ jobs:
633621 $EXAMPLES_BUILD_DIR/bin/imath-examples.exe
634622 shell : msys2 {0}
635623
636-
624+ - name : Examples (Apple Framework)
625+ if : inputs.namespace == '' && inputs.msystem == '' && inputs.IMATH_BUILD_APPLE_FRAMEWORK == 'ON'
626+ # Confirm the website examples compile against an Apple framework installation
627+ run : |
628+ set -x
629+ EXAMPLES_BUILD_DIR=$WORKSPACE/_build.examples.apple
630+ IMATH_DIR=$(find $INSTALL_DIR -type d -path "*/Imath.framework/*/Resources/CMake/Imath" | head -n 1)
631+ cmake_args=("-B" "$EXAMPLES_BUILD_DIR" "-S" "$WORKSPACE/website/examples")
632+ cmake_args+=("-DImath_DIR=$IMATH_DIR")
633+ cmake_args+=("-DCMAKE_BUILD_TYPE=${{ inputs.build-type }}")
634+ cmake_args+=("-DCMAKE_CXX_STANDARD=${{ inputs.cxx-standard }}")
635+ if [ -n "${{ inputs.CMAKE_SYSTEM_NAME }}" ]; then
636+ cmake_args+=("-DCMAKE_SYSTEM_NAME=${{ inputs.CMAKE_SYSTEM_NAME }}")
637+ fi
638+ if [ -n "${{ inputs.CMAKE_OSX_SYSROOT }}" ]; then
639+ cmake_args+=("-DCMAKE_OSX_SYSROOT=${{ inputs.CMAKE_OSX_SYSROOT }}")
640+ fi
641+ if [ -n "${{ inputs.CMAKE_OSX_ARCHITECTURES }}" ]; then
642+ cmake_args+=("-DCMAKE_OSX_ARCHITECTURES=${{ inputs.CMAKE_OSX_ARCHITECTURES }}")
643+ fi
644+ $CMAKE "${cmake_args[@]}"
645+ $CMAKE --build $EXAMPLES_BUILD_DIR --config ${{ inputs.build-type }}
646+ shell : bash
0 commit comments