From e017002baa192c8020c0364cfbeeff31b5706030 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Fri, 6 Feb 2026 00:52:59 +0900 Subject: [PATCH] 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 --- .github/workflows/ci.yml | 54 ++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcb3c8d..ce6a7f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: