diff --git a/.github/workflows/ci-cell.yml b/.github/workflows/ci-cell.yml index dc1f587..38eec13 100644 --- a/.github/workflows/ci-cell.yml +++ b/.github/workflows/ci-cell.yml @@ -32,6 +32,10 @@ jobs: if: runner.os == 'Linux' && inputs.c-compiler == 'clang' run: sudo apt-get update && sudo apt-get install -y clang + - name: Install TCC (Ubuntu) + if: runner.os == 'Linux' && inputs.c-compiler == 'tcc' + run: sudo apt-get update && sudo apt-get install -y tcc + - name: Setup MSYS2 MinGW if: runner.os == 'Windows' && inputs.c-compiler == 'mingw' uses: msys2/setup-msys2@v2 @@ -58,6 +62,14 @@ jobs: mkdir -p "$DEPS" + # TinyCC is for the cstring C path only; build deps with GCC/G++. + dep_c="${{ inputs.c-compiler }}" + dep_cxx="${{ inputs.cpp-compiler }}" + if [ "$dep_c" = "tcc" ]; then + dep_c=gcc + dep_cxx=g++ + fi + # 1. STLSoft git clone --depth 1 https://github.com/synesissoftware/STLSoft "$STLSRC" if [ "${{ inputs.c-compiler }}" = "cl" ]; then @@ -80,8 +92,8 @@ jobs: else cmake -S "$STLSRC" -B "$STLBUILD" \ -DCMAKE_BUILD_TYPE="${{ inputs.build-type }}" \ - -DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \ - -DCMAKE_CXX_COMPILER="${{ inputs.cpp-compiler }}" \ + -DCMAKE_C_COMPILER="$dep_c" \ + -DCMAKE_CXX_COMPILER="$dep_cxx" \ -DCMAKE_INSTALL_PREFIX="$DEPS" \ -DBUILD_EXAMPLES=OFF \ -DBUILD_TESTING=OFF @@ -113,8 +125,8 @@ jobs: else cmake -S "$SHWSRC" -B "$SHWBUILD" \ -DCMAKE_BUILD_TYPE="${{ inputs.build-type }}" \ - -DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \ - -DCMAKE_CXX_COMPILER="${{ inputs.cpp-compiler }}" \ + -DCMAKE_C_COMPILER="$dep_c" \ + -DCMAKE_CXX_COMPILER="$dep_cxx" \ -DCMAKE_INSTALL_PREFIX="$DEPS" \ -DCMAKE_PREFIX_PATH="$DEPS" \ -DBUILD_EXAMPLES=OFF \ @@ -147,8 +159,8 @@ jobs: else cmake -S "$XTSRC" -B "$XTBUILD" \ -DCMAKE_BUILD_TYPE="${{ inputs.build-type }}" \ - -DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \ - -DCMAKE_CXX_COMPILER="${{ inputs.cpp-compiler }}" \ + -DCMAKE_C_COMPILER="$dep_c" \ + -DCMAKE_CXX_COMPILER="$dep_cxx" \ -DCMAKE_INSTALL_PREFIX="$DEPS" \ -DCMAKE_PREFIX_PATH="$DEPS" \ -DBUILD_EXAMPLES=OFF \ @@ -177,13 +189,21 @@ jobs: -DBUILD_EXAMPLES=ON \ -DBUILD_TESTING=ON else + # TinyCC: C library + C unit-tests only (deps built with GCC above). + build_examples=ON + no_cpp_api=OFF + if [ "${{ inputs.c-compiler }}" = "tcc" ]; then + build_examples=OFF + no_cpp_api=ON + fi cmake -B build -S . \ -DCMAKE_BUILD_TYPE="${{ inputs.build-type }}" \ -DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \ -DCMAKE_CXX_COMPILER="${{ inputs.cpp-compiler }}" \ -DCMAKE_PREFIX_PATH="${RUNNER_TEMP}/sis-deps" \ - -DBUILD_EXAMPLES=ON \ - -DBUILD_TESTING=ON + -DBUILD_EXAMPLES=${build_examples} \ + -DBUILD_TESTING=ON \ + -DNO_CSTRING_CPP_API:BOOL=${no_cpp_api} fi - name: Build @@ -209,6 +229,7 @@ jobs: run-examples: name: Examples (${{ inputs.cell-id }}) needs: build + if: inputs.c-compiler != 'tcc' runs-on: ${{ inputs.os }} steps: @@ -271,6 +292,7 @@ jobs: test-component: name: Component tests (${{ inputs.cell-id }}) needs: build + if: inputs.c-compiler != 'tcc' runs-on: ${{ inputs.os }} steps: @@ -302,6 +324,7 @@ jobs: test-scratch: name: Scratch tests (${{ inputs.cell-id }}) needs: build + if: inputs.c-compiler != 'tcc' continue-on-error: true runs-on: ${{ inputs.os }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fef22db..c4f4a9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,10 @@ jobs: os: ubuntu-latest c_compiler: gcc cpp_compiler: g++ + - id: linux-tcc + os: ubuntu-latest + c_compiler: tcc + cpp_compiler: g++ - id: macos-clang os: macos-latest c_compiler: clang @@ -72,6 +76,9 @@ jobs: - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ + - os: ubuntu-latest + c_compiler: tcc + cpp_compiler: g++ - os: macos-latest c_compiler: clang cpp_compiler: clang++ @@ -89,6 +96,10 @@ jobs: if: runner.os == 'Linux' && matrix.c_compiler == 'clang' run: sudo apt-get update && sudo apt-get install -y clang + - name: Install TCC (Ubuntu) + if: runner.os == 'Linux' && matrix.c_compiler == 'tcc' + run: sudo apt-get update && sudo apt-get install -y tcc + - name: Setup MSYS2 MinGW if: runner.os == 'Windows' && matrix.c_compiler == 'mingw' uses: msys2/setup-msys2@v2 diff --git a/CHANGES.md b/CHANGES.md index 14c4111..03998c1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,8 @@ * Added **HOW_YOU_CAN_HELP.md**; * **TODO.md** — marked `CMAKE_INSTALL_LIBDIR` complete; * **run_all_examples.sh**, **run_all_unit_tests.sh**, **run_all_scratch_tests.sh** — coloured list/execute path output (via `tput`); +* Linux **TinyCC** (**tcc**) CI cell and install-smoke row (via `apt-get install tcc`); deps built with **GCC**/**G++**; **`NO_CSTRING_CPP_API`** and examples skipped for the **tcc** cell; +* **CMakeLists.txt** — when `CMAKE_C_COMPILER_ID` is **TinyCC**, use `CMAKE_C_STANDARD` **99** (distro **tcc** lacks ISO C17); ## 4.0.13 - 2nd August 2026 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d5f13b..6ff4148 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ # Purpose: Top-level CMake lists file for cstring # # Created: 21st December 2023 -# Updated: 6th August 2026 +# Updated: 7th August 2026 # # ######################################################################## # @@ -67,6 +67,13 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON) +# Distro TinyCC (e.g. Ubuntu `tcc` 0.9.27) does not implement ISO C17; keep +# a portable C99 dialect so the Linux TCC CI cell can exercise the C path. +if(CMAKE_C_COMPILER_ID STREQUAL "TinyCC") + + set(CMAKE_C_STANDARD 99) +endif() + if(MSVC) if(MSVC_VERSION LESS 1800) diff --git a/TODO.md b/TODO.md index f5f5309..3ba1c20 100644 --- a/TODO.md +++ b/TODO.md @@ -40,6 +40,7 @@ * [x] ~~~macOS~~~ - ✅; * [x] ~~~Unix (ubuntu)~~~ - ✅; * [x] ~~~Windows~~~ - ✅; + * [x] ~~~Linux TinyCC (**tcc**) cell + install-smoke~~~ - ✅; * [ ] Debug configuration; * [ ] Release configuration; * [ ] exercise `--no-cpp` / `--no-shwild` permutations beyond the current jobs;