Use CMake and ctest for Linux and macOS native builds

Convert manual g++/clang++ builds to CMake for consistency with
Windows builds:
- Linux x64 (GCC)
- Linux ARM64 (GCC)
- macOS ARM64 Apple Silicon (Clang)

All native builds now use:
- cmake -B build -DTINYGLTF_BUILD_LOADER_EXAMPLE=ON
- cmake --build build
- ctest --test-dir build --output-on-failure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Syoyo Fujita
2026-02-06 00:52:59 +09:00
parent 10ac914244
commit 797bf0e023

View File

@@ -25,19 +25,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Build loader_example
run: |
g++ -std=c++11 -o loader_example loader_example.cc
- name: Configure
run: cmake -B build -DTINYGLTF_BUILD_LOADER_EXAMPLE=ON
- name: Build
run: cmake --build build
- name: Run loader_example
run: |
./loader_example models/Cube/Cube.gltf
run: ./build/loader_example models/Cube/Cube.gltf
- name: Build and run unit tests
run: |
cd tests
g++ -I../ -std=c++11 -g -O0 -o tester tester.cc
./tester
- name: Run tests
run: ctest --test-dir build --output-on-failure
# Linux x64 - Clang 21
linux-clang-x64:
@@ -75,19 +73,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Build loader_example
run: |
g++ -std=c++11 -o loader_example loader_example.cc
- name: Configure
run: cmake -B build -DTINYGLTF_BUILD_LOADER_EXAMPLE=ON
- name: Build
run: cmake --build build
- name: Run loader_example
run: |
./loader_example models/Cube/Cube.gltf
run: ./build/loader_example models/Cube/Cube.gltf
- name: Build and run unit tests
run: |
cd tests
g++ -I../ -std=c++11 -g -O0 -o tester tester.cc
./tester
- name: Run tests
run: ctest --test-dir build --output-on-failure
# macOS ARM64 Apple Silicon
macos-arm64:
@@ -97,19 +93,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Build loader_example
run: |
clang++ -std=c++11 -o loader_example loader_example.cc
- name: Configure
run: cmake -B build -DTINYGLTF_BUILD_LOADER_EXAMPLE=ON
- name: Build
run: cmake --build build
- name: Run loader_example
run: |
./loader_example models/Cube/Cube.gltf
run: ./build/loader_example models/Cube/Cube.gltf
- name: Build and run unit tests
run: |
cd tests
clang++ -I../ -std=c++11 -g -O0 -o tester tester.cc
./tester
- name: Run tests
run: ctest --test-dir build --output-on-failure
# Windows x64 - MSVC
windows-msvc-x64: