diff options
| author | Andre Weissflog <floooh@gmail.com> | 2022-11-19 21:18:26 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2022-11-19 21:18:26 +0100 |
| commit | 6d3dd90ddce1da8fbec39efa84dbf2825326fbd0 (patch) | |
| tree | 32807f2f206376cd005015b50af2cf10f5840c4a | |
| parent | 0d1e8360d8623ca4d44f475eab5196f8a98d990a (diff) | |
cmake presets for iOS and macOS
| -rw-r--r-- | .github/workflows/main.yml | 106 | ||||
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | CMakePresets.json | 134 | ||||
| -rw-r--r-- | tests/ext/CMakeLists.txt | 158 | ||||
| -rw-r--r-- | tests/test_common.sh | 32 | ||||
| -rwxr-xr-x | tests/test_ios.sh | 19 | ||||
| -rwxr-xr-x | tests/test_macos.sh | 19 |
7 files changed, 283 insertions, 186 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d344aba3..a707cd5d 100644 --- a/.github/workflows/main.yml +++ b/.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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 2390b503..32c86d4d 100644 --- a/CMakeLists.txt +++ b/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 diff --git a/CMakePresets.json b/CMakePresets.json index 61072ed4..f16e3e97 100644 --- a/CMakePresets.json +++ b/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" ] } ] } diff --git a/tests/ext/CMakeLists.txt b/tests/ext/CMakeLists.txt index 6c611e06..4ded7c41 100644 --- a/tests/ext/CMakeLists.txt +++ b/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) diff --git a/tests/test_common.sh b/tests/test_common.sh index 1515eb90..6708a16b 100644 --- a/tests/test_common.sh +++ b/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 ../../.. } diff --git a/tests/test_ios.sh b/tests/test_ios.sh index ea8a58f0..0d087f9d 100755 --- a/tests/test_ios.sh +++ b/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 diff --git a/tests/test_macos.sh b/tests/test_macos.sh index b2bcf999..2f28a8a9 100755 --- a/tests/test_macos.sh +++ b/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 |