Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions .github/workflows/ci-cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -209,6 +229,7 @@ jobs:
run-examples:
name: Examples (${{ inputs.cell-id }})
needs: build
if: inputs.c-compiler != 'tcc'
runs-on: ${{ inputs.os }}

steps:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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++
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Purpose: Top-level CMake lists file for cstring
#
# Created: 21st December 2023
# Updated: 6th August 2026
# Updated: 7th August 2026
#
# ######################################################################## #

Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading