Ver código fonte

cmake presets for iOS and macOS

Andre Weissflog 2 anos atrás
pai
commit
6d3dd90ddc
7 arquivos alterados com 283 adições e 186 exclusões
  1. 52 54
      .github/workflows/main.yml
  2. 0 1
      CMakeLists.txt
  3. 126 8
      CMakePresets.json
  4. 80 78
      tests/ext/CMakeLists.txt
  5. 7 25
      tests/test_common.sh
  6. 9 10
      tests/test_ios.sh
  7. 9 10
      tests/test_macos.sh

+ 52 - 54
.github/workflows/main.yml

@@ -3,15 +3,15 @@ name: "Build & Test"
 on: [push, pull_request]
 
 jobs:
-    windows:
-        runs-on: windows-latest
-        steps:
-        - uses: actions/checkout@v2
-        - name: test_win
-          run: |
-            cd tests
-            test_win.cmd
-          shell: cmd
+    #windows:
+    #    runs-on: windows-latest
+    #    steps:
+    #    - uses: actions/checkout@v2
+    #    - name: test_win
+    #      run: |
+    #        cd tests
+    #        test_win.cmd
+    #      shell: cmd
     mac:
         runs-on: macos-latest
         steps:
@@ -19,7 +19,6 @@ jobs:
         - uses: seanmiddleditch/gha-setup-ninja@master
         - name: test_macos
           run: |
-            cd tests
             ./test_macos.sh
     ios:
         runs-on: macos-latest
@@ -27,48 +26,47 @@ jobs:
         - uses: actions/checkout@v2
         - name: test_ios
           run: |
-            cd tests
             ./test_ios.sh
-    linux:
-        runs-on: ubuntu-latest
-        steps:
-        - uses: actions/checkout@v2
-        - uses: seanmiddleditch/gha-setup-ninja@master
-        - name: prepare
-          run: |
-            sudo apt-get update
-            sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev mesa-common-dev xorg-dev libasound-dev
-        - name: test_linux
-          run: |
-            cd tests
-            ./test_linux.sh
-    emscripten:
-        runs-on: ubuntu-latest
-        steps:
-        - uses: actions/checkout@v2
-        - uses: seanmiddleditch/gha-setup-ninja@master
-        - name: test_emscripten
-          run: |
-            cd tests
-            ./test_emscripten.sh
-    android:
-        runs-on: ubuntu-latest
-        steps:
-        - uses: actions/checkout@v2
-        - uses: seanmiddleditch/gha-setup-ninja@master
-        - uses: actions/setup-java@v1
-          with:
-            java-version: '8'
-        - name: test_android
-          run: |
-            cd tests
-            ./test_android.sh
-    uwp:
-        runs-on: windows-latest
-        steps:
-        - uses: actions/checkout@v2
-        - name: test_uwp
-          run: |
-            cd tests
-            test_uwp.cmd
-          shell: cmd
+    #linux:
+    #    runs-on: ubuntu-latest
+    #    steps:
+    #    - uses: actions/checkout@v2
+    #    - uses: seanmiddleditch/gha-setup-ninja@master
+    #    - name: prepare
+    #      run: |
+    #        sudo apt-get update
+    #        sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev mesa-common-dev xorg-dev libasound-dev
+    #    - name: test_linux
+    #      run: |
+    #        cd tests
+    #        ./test_linux.sh
+    #emscripten:
+    #    runs-on: ubuntu-latest
+    #    steps:
+    #    - uses: actions/checkout@v2
+    #    - uses: seanmiddleditch/gha-setup-ninja@master
+    #    - name: test_emscripten
+    #      run: |
+    #        cd tests
+    #        ./test_emscripten.sh
+    #android:
+    #    runs-on: ubuntu-latest
+    #    steps:
+    #    - uses: actions/checkout@v2
+    #    - uses: seanmiddleditch/gha-setup-ninja@master
+    #    - uses: actions/setup-java@v1
+    #      with:
+    #        java-version: '8'
+    #    - name: test_android
+    #      run: |
+    #        cd tests
+    #        ./test_android.sh
+    #uwp:
+    #    runs-on: windows-latest
+    #    steps:
+    #    - uses: actions/checkout@v2
+    #    - name: test_uwp
+    #      run: |
+    #        cd tests
+    #        test_uwp.cmd
+    #      shell: cmd

+ 0 - 1
CMakeLists.txt

@@ -3,7 +3,6 @@
 #
 cmake_minimum_required(VERSION 3.20)
 project(sokol-test)
-include(FetchContent)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 set(CMAKE_C_STANDARD 11)
 set(CMAKE_CXX_STANDARD 17)  # needed for UWP

+ 126 - 8
CMakePresets.json

@@ -8,7 +8,6 @@
     "configurePresets": [
         {
             "name": "macos_gl_debug",
-            "displayName": "macOS OpenGL Debug",
             "generator": "Ninja",
             "binaryDir": "tests/build/macos_gl_debug",
             "cacheVariables": {
@@ -18,7 +17,6 @@
         },
         {
             "name": "macos_gl_release",
-            "displayName": "macOS OpenGL Release",
             "generator": "Ninja",
             "binaryDir": "tests/build/macos_gl_release",
             "cacheVariables": {
@@ -28,7 +26,6 @@
         },
         {
             "name": "macos_metal_debug",
-            "displayName": "macOS Metal Debug",
             "generator": "Ninja",
             "binaryDir": "tests/build/macos_metal_debug",
             "cacheVariables": {
@@ -38,7 +35,6 @@
         },
         {
             "name": "macos_metal_release",
-            "displayName": "macOS Metal Release",
             "generator": "Ninja",
             "binaryDir": "tests/build/macos_metal_release",
             "cacheVariables": {
@@ -48,7 +44,6 @@
         },
         {
             "name": "macos_arc_gl_debug",
-            "displayName": "macOS ARC OpenGL Debug",
             "generator": "Ninja",
             "binaryDir": "tests/build/macos_arc_gl_debug",
             "cacheVariables": {
@@ -62,7 +57,6 @@
         },
         {
             "name": "macos_arc_gl_release",
-            "displayName": "macOS ARC OpenGL Debug",
             "generator": "Ninja",
             "binaryDir": "tests/build/macos_arc_gl_release",
             "cacheVariables": {
@@ -76,7 +70,6 @@
         },
         {
             "name": "macos_arc_metal_debug",
-            "displayName": "macOS ARC Metal Debug",
             "generator": "Ninja",
             "binaryDir": "tests/build/macos_arc_metal_debug",
             "cacheVariables": {
@@ -90,7 +83,6 @@
         },
         {
             "name": "macos_arc_metal_release",
-            "displayName": "macOS ARC Metal Release",
             "generator": "Ninja",
             "binaryDir": "tests/build/macos_arc_metal_release",
             "cacheVariables": {
@@ -101,6 +93,132 @@
                 },
                 "CMAKE_BUILD_TYPE": "Release"
             }
+        },
+        {
+            "name": "ios_gl",
+            "generator": "Xcode",
+            "binaryDir": "tests/build/ios_gl",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_GLES3",
+                "CMAKE_SYSTEM_NAME": "iOS"
+            }
+        },
+        {
+            "name": "ios_metal",
+            "generator": "Xcode",
+            "binaryDir": "tests/build/ios_metal",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_METAL",
+                "CMAKE_SYSTEM_NAME": "iOS"
+            }
+        },
+        {
+            "name": "ios_arc_gl",
+            "generator": "Xcode",
+            "binaryDir": "tests/build/ios_arc_gl",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_GLES3",
+                "USE_ARC": {
+                    "type": "BOOL",
+                    "value": "ON"
+                },
+                "CMAKE_SYSTEM_NAME": "iOS"
+            }
+        },
+        {
+            "name": "ios_arc_metal",
+            "generator": "Xcode",
+            "binaryDir": "tests/build/ios_arc_metal",
+            "cacheVariables": {
+                "SOKOL_BACKEND": "SOKOL_METAL",
+                "USE_ARC": {
+                    "type": "BOOL",
+                    "value": "ON"
+                },
+                "CMAKE_SYSTEM_NAME": "iOS"
+            }
+        }
+    ],
+    "buildPresets": [
+        {
+            "name": "macos_gl_debug",
+            "configurePreset": "macos_gl_debug"
+        },
+        {
+            "name": "macos_gl_release",
+            "configurePreset": "macos_gl_release"
+        },
+        {
+            "name": "macos_metal_debug",
+            "configurePreset": "macos_metal_debug"
+        },
+        {
+            "name": "macos_metal_release",
+            "configurePreset": "macos_metal_release"
+        },
+        {
+            "name": "macos_arc_gl_debug",
+            "configurePreset": "macos_arc_gl_debug"
+        },
+        {
+            "name": "macos_arc_gl_release",
+            "configurePreset": "macos_arc_gl_release"
+        },
+        {
+            "name": "macos_arc_metal_debug",
+            "configurePreset": "macos_arc_metal_debug"
+        },
+        {
+            "name": "macos_arc_metal_release",
+            "configurePreset": "macos_arc_metal_release"
+        },
+        {
+            "name": "ios_gl_debug",
+            "configurePreset": "ios_gl",
+            "configuration": "Debug",
+            "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
+        },
+        {
+            "name": "ios_gl_release",
+            "configurePreset": "ios_gl",
+            "configuration": "Release",
+            "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
+        },
+        {
+            "name": "ios_metal_debug",
+            "configurePreset": "ios_metal",
+            "configuration": "Debug",
+            "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
+        },
+        {
+            "name": "ios_metal_release",
+            "configurePreset": "ios_metal",
+            "configuration": "Release",
+            "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
+        },
+        {
+            "name": "ios_arc_gl_debug",
+            "configurePreset": "ios_arc_gl",
+            "configuration": "Debug",
+            "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
+        },
+        {
+            "name": "ios_arc_gl_release",
+            "configurePreset": "ios_arc_gl",
+            "configuration": "Release",
+            "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
+        },
+        {
+            "name": "ios_arc_metal_debug",
+            "configurePreset": "ios_arc_metal",
+            "configuration": "Debug",
+            "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
+        },
+        {
+            "name": "ios_arc_metal_release",
+            "configurePreset": "ios_arc_metal",
+            "configuration": "Release",
+            "nativeToolOptions": [ "CODE_SIGN_IDENTITY=\"\"", "CODE_SIGNING_REQUIRED=NO", "CODE_SIGNING_ALLOWED=NO" ]
         }
     ]
 }

+ 80 - 78
tests/ext/CMakeLists.txt

@@ -1,80 +1,82 @@
 # external dependencies
-FetchContent_Declare(
-    spineruntimes
-    GIT_REPOSITORY https://github.com/EsotericSoftware/spine-runtimes
-    GIT_SUBMODULES_RECURSE ON
-    GIT_SHALLOW ON
-    GIT_TAG "4.1"
-)
-FetchContent_Declare(
-    fipscimgui
-    GIT_REPOSITORY https://github.com/fips-libs/fips-cimgui
-    GIT_SUBMODULES_RECURSE ON
-    GIT_SHALLOW ON
-)
-FetchContent_Populate(fipscimgui)
-FetchContent_Populate(spineruntimes)
+
+# NOTE FetchContent is so frigging slow that we just run git directly
+set(cimgui_dir ${CMAKE_BINARY_DIR}/../_deps/cimgui)
+set(spineruntimes_dir ${CMAKE_BINARY_DIR}/../_deps/spineruntimes)
+
+if (IS_DIRECTORY ${cimgui_dir})
+    message("### ${cimgui_dir} exists...")
+else()
+    message("### Fetching cimgui to ${cimgui_dir} (this may take a while...)")
+    execute_process(COMMAND git clone --depth=1 --recursive https://github.com/fips-libs/fips-cimgui ${cimgui_dir})
+endif()
+if (IS_DIRECTORY ${spineruntimes_dir})
+    message("### ${spineruntimes_dir} exists...")
+else()
+    message("### Fetching spine runtimes to ${spineruntimes_dir} (this may take a while...)")
+    execute_process(COMMAND git clone --depth=1 --recursive https://github.com/EsotericSoftware/spine-runtimes ${spineruntimes_dir})
+endif()
 
 add_library(cimgui
-    ${fipscimgui_SOURCE_DIR}/cimgui/cimgui.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui_demo.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui_draw.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui_tables.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui_widgets.cpp)
-target_include_directories(cimgui SYSTEM PUBLIC ${fipscimgui_SOURCE_DIR})
+    ${cimgui_dir}/cimgui/cimgui.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui_demo.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui_draw.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui_tables.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui_widgets.cpp)
+target_include_directories(cimgui SYSTEM PUBLIC ${cimgui_dir})
 
 add_library(imgui
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui_demo.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui_draw.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui_tables.cpp
-    ${fipscimgui_SOURCE_DIR}/cimgui/imgui/imgui_widgets.cpp)
-target_include_directories(imgui SYSTEM PUBLIC ${fipscimgui_SOURCE_DIR}/cimgui/imgui)
+    ${cimgui_dir}/cimgui/imgui/imgui.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui_demo.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui_draw.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui_tables.cpp
+    ${cimgui_dir}/cimgui/imgui/imgui_widgets.cpp)
+target_include_directories(imgui SYSTEM PUBLIC ${cimgui_dir}/cimgui/imgui)
 
 add_library(spine
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Animation.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/AnimationState.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/AnimationStateData.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Array.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Atlas.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/AtlasAttachmentLoader.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Attachment.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/AttachmentLoader.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Bone.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/BoneData.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/BoundingBoxAttachment.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/ClippingAttachment.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Color.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Debug.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Event.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/EventData.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/IkConstraint.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/IkConstraintData.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Json.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Json.h
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/MeshAttachment.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/PathAttachment.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/PathConstraint.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/PathConstraintData.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/PointAttachment.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/RegionAttachment.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Sequence.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Skeleton.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/SkeletonBinary.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/SkeletonBounds.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/SkeletonClipping.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/SkeletonData.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/SkeletonJson.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Skin.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Slot.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/SlotData.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/TransformConstraint.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/TransformConstraintData.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/Triangulator.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/VertexAttachment.c
-    ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/src/spine/extension.c)
-target_include_directories(spine SYSTEM PUBLIC ${spineruntimes_SOURCE_DIR}/spine-c/spine-c/include)
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Animation.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/AnimationState.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/AnimationStateData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Array.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Atlas.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/AtlasAttachmentLoader.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Attachment.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/AttachmentLoader.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Bone.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/BoneData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/BoundingBoxAttachment.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/ClippingAttachment.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Color.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Debug.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Event.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/EventData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/IkConstraint.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/IkConstraintData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Json.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Json.h
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/MeshAttachment.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/PathAttachment.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/PathConstraint.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/PathConstraintData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/PointAttachment.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/RegionAttachment.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Sequence.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Skeleton.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/SkeletonBinary.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/SkeletonBounds.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/SkeletonClipping.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/SkeletonData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/SkeletonJson.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Skin.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Slot.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/SlotData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/TransformConstraint.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/TransformConstraintData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/Triangulator.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/VertexAttachment.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/extension.c)
+target_include_directories(spine SYSTEM PUBLIC ${spineruntimes_dir}/spine-c/spine-c/include)
 if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
     target_compile_options(spine PRIVATE /wd4267 /wd4244)   # conversion from 'x' to 'y' possible loss of data
 endif()
@@ -82,14 +84,14 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     target_compile_options(spine PRIVATE -Wno-shorten-64-to-32)
 endif()
 
-file(COPY ${spineruntimes_SOURCE_DIR}/examples/spineboy/export/spineboy-pro.json DESTINATION ${CMAKE_BINARY_DIR})
-file(COPY ${spineruntimes_SOURCE_DIR}/examples/spineboy/export/spineboy-pro.skel DESTINATION ${CMAKE_BINARY_DIR})
-file(COPY ${spineruntimes_SOURCE_DIR}/examples/spineboy/export/spineboy.atlas DESTINATION ${CMAKE_BINARY_DIR})
-file(COPY ${spineruntimes_SOURCE_DIR}/examples/spineboy/export/spineboy.png DESTINATION ${CMAKE_BINARY_DIR})
+file(COPY ${spineruntimes_dir}/examples/spineboy/export/spineboy-pro.json DESTINATION ${CMAKE_BINARY_DIR})
+file(COPY ${spineruntimes_dir}/examples/spineboy/export/spineboy-pro.skel DESTINATION ${CMAKE_BINARY_DIR})
+file(COPY ${spineruntimes_dir}/examples/spineboy/export/spineboy.atlas DESTINATION ${CMAKE_BINARY_DIR})
+file(COPY ${spineruntimes_dir}/examples/spineboy/export/spineboy.png DESTINATION ${CMAKE_BINARY_DIR})
 
-file(COPY ${spineruntimes_SOURCE_DIR}/examples/spineboy/export/spineboy-pro.json DESTINATION ${CMAKE_BINARY_DIR}/Debug)
-file(COPY ${spineruntimes_SOURCE_DIR}/examples/spineboy/export/spineboy-pro.skel DESTINATION ${CMAKE_BINARY_DIR}/Debug)
-file(COPY ${spineruntimes_SOURCE_DIR}/examples/spineboy/export/spineboy.atlas DESTINATION ${CMAKE_BINARY_DIR}/Debug)
-file(COPY ${spineruntimes_SOURCE_DIR}/examples/spineboy/export/spineboy.png DESTINATION ${CMAKE_BINARY_DIR}/Debug)
+file(COPY ${spineruntimes_dir}/examples/spineboy/export/spineboy-pro.json DESTINATION ${CMAKE_BINARY_DIR}/Debug)
+file(COPY ${spineruntimes_dir}/examples/spineboy/export/spineboy-pro.skel DESTINATION ${CMAKE_BINARY_DIR}/Debug)
+file(COPY ${spineruntimes_dir}/examples/spineboy/export/spineboy.atlas DESTINATION ${CMAKE_BINARY_DIR}/Debug)
+file(COPY ${spineruntimes_dir}/examples/spineboy/export/spineboy.png DESTINATION ${CMAKE_BINARY_DIR}/Debug)
 
 add_library(nuklear nuklear.c)

+ 7 - 25
tests/test_common.sh

@@ -26,10 +26,12 @@ setup_android() {
 }
 
 build() {
-    preset=$1
-    cmake --preset $preset ../..
-    cmake --build .
-    cd ../..
+    gen_preset=$1
+    build_preset=$2
+#    cd ..
+    cmake --preset $gen_preset
+    cmake --build --preset $build_preset
+#    cd tests
 }
 
 build_force_egl() {
@@ -52,16 +54,6 @@ analyze() {
     cd ../..
 }
 
-build_arc() {
-    cfg=$1
-    backend=$2
-    mode=$3
-    mkdir -p build/$cfg && cd build/$cfg
-    cmake -GNinja -DSOKOL_BACKEND=$backend -DUSE_ARC:BOOL=ON -DCMAKE_BUILD_TYPE=$mode ../..
-    cmake --build .
-    cd ../..
-}
-
 analyze_arc() {
     cfg=$1
     backend=$2
@@ -72,16 +64,6 @@ analyze_arc() {
     cd ../..
 }
 
-build_ios() {
-    cfg=$1
-    backend=$2
-    mode=$3
-    mkdir -p build/$cfg && cd build/$cfg
-    cmake -GXcode -DSOKOL_BACKEND=$backend -DCMAKE_SYSTEM_NAME=iOS ../..
-    cmake --build . --config $mode -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
-    cd ../..
-}
-
 analyze_ios() {
     cfg=$1
     backend=$2
@@ -134,7 +116,7 @@ build_android() {
 
 runtest() {
     cfg=$1
-    cd build/$cfg
+    cd tests/build/$cfg
     ./sokol-test
     cd ../../..
 }

+ 9 - 10
tests/test_ios.sh

@@ -1,11 +1,10 @@
 set -e
-source test_common.sh
-prepare
-build_ios ios_gl_debug SOKOL_GLES3 Debug
-build_ios ios_gl_release SOKOL_GLES3 Release
-build_ios ios_metal_debug SOKOL_METAL Debug
-build_ios ios_metal_release SOKOL_METAL Release
-build_arc_ios ios_arc_gl_debug SOKOL_GLES3 Debug
-build_arc_ios ios_arc_gl_release SOKOL_GLES3 Release
-build_arc_ios ios_arc_metal_debug SOKOL_METAL Debug
-build_arc_ios ios_arc_metal_release SOKOL_METAL Release
+source tests/test_common.sh
+build ios_gl ios_gl_debug
+build ios_gl ios_gl_release
+build ios_metal ios_metal_debug
+build ios_metal ios_metal_release
+build ios_arc_gl ios_arc_gl_debug
+build ios_arc_gl ios_arc_gl_release
+build ios_arc_metal ios_arc_metal_debug
+build ios_arc_metal ios_arc_metal_release

+ 9 - 10
tests/test_macos.sh

@@ -1,12 +1,11 @@
 set -e
-source test_common.sh
-prepare
-build macos_gl_debug SOKOL_GLCORE33 Debug
-build macos_gl_release SOKOL_GLCORE33 Release
-build macos_metal_debug SOKOL_METAL Debug
-build macos_metal_release SOKOL_METAL Release
-build_arc macos_arc_gl_debug SOKOL_GLCORE33 Debug
-build_arc macos_arc_gl_release SOKOL_GLCORE33 Release
-build_arc macos_arc_metal_debug SOKOL_METAL Debug
-build_arc macos_arc_metal_release SOKOL_METAL Release
+source tests/test_common.sh
+build macos_gl_debug macos_gl_debug
+build macos_gl_release macos_gl_release
+build macos_metal_debug macos_metal_debug
+build macos_metal_release macos_metal_release
+build macos_arc_gl_debug macos_arc_gl_debug
+build macos_arc_gl_release macos_arc_gl_release
+build macos_arc_metal_debug macos_arc_metal_debug
+build macos_arc_metal_release macos_arc_metal_release
 runtest macos_gl_debug