diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1864533..a3fd669d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,13 +3,17 @@ name: CI on: push: branches: - - boilerplate + - master - dev + - boilerplate + - cmake-fix - idiomatic - - master - rc1 - rc2 - rc3 + - rc4 + - rc5 + - update pull_request: concurrency: @@ -100,13 +104,15 @@ jobs: mingw-w64-x86_64-cmake mingw-w64-x86_64-make - - name: Install STLSoft dependency + - name: Install STLSoft and b64 dependencies shell: bash run: | set -euo pipefail DEPS="${RUNNER_TEMP}/sis-deps" STLSRC="${RUNNER_TEMP}/stlsoft-src" STLBUILD="${RUNNER_TEMP}/stlsoft-build" + B64SRC="${RUNNER_TEMP}/b64-src" + B64BUILD="${RUNNER_TEMP}/b64-build" mkdir -p "$DEPS" git clone --depth 1 https://github.com/synesissoftware/STLSoft "$STLSRC" if [ "${{ matrix.c_compiler }}" = "cl" ]; then @@ -137,6 +143,38 @@ jobs: cmake --build "$STLBUILD" --parallel cmake --install "$STLBUILD" fi + git clone --depth 1 https://github.com/synesissoftware/b64 "$B64SRC" + if [ "${{ matrix.c_compiler }}" = "cl" ]; then + cmake -S "$B64SRC" -B "$B64BUILD" \ + -DCMAKE_DISABLE_FIND_PACKAGE_MFC=TRUE \ + -DCMAKE_PREFIX_PATH="$DEPS" \ + -DCMAKE_INSTALL_PREFIX="$DEPS" \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_TESTING=OFF + cmake --build "$B64BUILD" --config "${{ env.BUILD_TYPE }}" --parallel + cmake --install "$B64BUILD" --config "${{ env.BUILD_TYPE }}" + elif [ "${{ matrix.c_compiler }}" = "mingw" ]; then + export PATH="/mingw64/bin:$PATH" + cmake -S "$B64SRC" -B "$B64BUILD" -G "MinGW Makefiles" \ + -DCMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" \ + -DCMAKE_PREFIX_PATH="$DEPS" \ + -DCMAKE_INSTALL_PREFIX="$DEPS" \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_TESTING=OFF + cmake --build "$B64BUILD" --parallel 2 + cmake --install "$B64BUILD" + else + cmake -S "$B64SRC" -B "$B64BUILD" \ + -DCMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" \ + -DCMAKE_C_COMPILER="${{ matrix.c_compiler }}" \ + -DCMAKE_CXX_COMPILER="${{ matrix.cpp_compiler }}" \ + -DCMAKE_PREFIX_PATH="$DEPS" \ + -DCMAKE_INSTALL_PREFIX="$DEPS" \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_TESTING=OFF + cmake --build "$B64BUILD" --parallel + cmake --install "$B64BUILD" + fi echo "SIS_DEPS=$DEPS" >> "$GITHUB_ENV" - name: Configure @@ -209,7 +247,7 @@ jobs: cat > "$CONSUMER/CMakeLists.txt" <<'EOF' cmake_minimum_required(VERSION 3.13) project(pantheios_install_smoke CXX) - find_package(STLSoft REQUIRED) + # STLSoft and b64 must come from pantheios-config.cmake's find_dependency(). find_package(Pantheios REQUIRED) add_executable(consumer consumer.cpp) # Link order matters for GNU ld (static archives are single-pass): diff --git a/.vscode/settings.json b/.vscode/settings.json index 3fe51d2b..a20fc3ce 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,8 @@ "editor.tabSize": 4, }, "[c]": { + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnSave": true, "editor.insertSpaces": true, "editor.rulers": [ 60, 64, 68, 72, 76 ], "editor.tabSize": 4, @@ -14,6 +16,8 @@ "editor.tabSize": 4, }, "[cpp]": { + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnSave": true, "editor.insertSpaces": true, "editor.rulers": [ 60, 64, 68, 72, 76 ], "editor.tabSize": 4, @@ -49,7 +53,17 @@ "editor.insertSpaces": true, "editor.tabSize": 2, }, + "C_Cpp.autocompleteAddParentheses": true, + "C_Cpp.clang_format_fallbackStyle": "none", + "C_Cpp.clang_format_style": "file", + "C_Cpp.default.cStandard": "c17", + "C_Cpp.default.cppStandard": "c++17", + "C_Cpp.enhancedColorization": "enabled", + "C_Cpp.errorSquiggles": "enabled", + "C_Cpp.formatting": "clangFormat", + "C_Cpp.intelliSenseEngine": "default", "cmake.configureOnOpen": false, + "debug.allowBreakpointsEverywhere": true, "editor.detectIndentation": false, "editor.insertSpaces": false, "editor.renderWhitespace": "all", @@ -128,6 +142,7 @@ "numeric": "cpp", "optional": "cpp", "ostream": "cpp", + "print": "cpp", "queue": "cpp", "random": "cpp", "ranges": "cpp", diff --git a/CHANGES.md b/CHANGES.md index 3b522f23..4ba63b84 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,12 @@ -# Pantheios - CHANGES +# Pantheios - Changes + + +## 1.0.1-rc2 - 6th September 2026 + +* **CMake** package configuration: loaded `CMakeFindDependencyMacro` and added conditional `find_dependency()` calls for **STLSoft** and **b64** in **`pantheios-config.cmake`**; ensures exported static targets (such as `Pantheios::Pantheios.core`) provide transitive interface link dependencies (`b64::core`, `STLSoft::STLSoft`) to downstream consumers without requiring callers to invoke `find_package(b64)` manually; +* version definition: added `PANTHEIOS_VER_1_0_1_RC2` (`0x010001e2`) and updated `PANTHEIOS_VER` to RC2 in **include/pantheios/pantheios.h**; +* tooling and configuration: added **`.vscode/settings.json`**; +* documentation and release alignment: updated **NEWS.md**, **INSTALL.md**, and **KNOWN_ISSUES.md** for the 1.0.1-rc2 release; ## 1.0.1-rc1 - 5th August 2026 @@ -7,6 +15,7 @@ * documentation modernisation: **CHANGES.md** (from **CHANGES.txt**), removal of **HISTORY.md** and **README.txt**, and updates to **README.md**, **FAQ.md**, **INSTALL.md**, **TODO.md**, **KNOWN_ISSUES.md**, **AUTHORS.md**, and **HOW_YOU_CAN_HELP.md**; * new stock back-end **bec.AnsiConsole** / **be.AnsiConsole** (bel/ber, colouring flags, argument parsing, unit and scratch tests); * **CMake** enhancements: **Threads** / `PANTHEIOS_FORCE_MT`, `BUILD_TESTING`, optional **b64** via `NO_B64` / **`--no-b64`**, CMP0177, lowercase export package (**`pantheios-config.cmake`**), improved **STLSoft** include handling, and **`_BUILD_AS_UNIX`** / **`_BUILD_AS_WIN32`** OS discrimination; +* **CMake** package config: `find_dependency()` for **STLSoft** and (when built with it) **b64**, so consumers of **`Pantheios::Pantheios.core`** no longer see a missing **`b64::core`** imported target; * modern composite **`PANTHEIOS_VER`** (`MAJOR` / `MINOR` / `PATCH` / `ALPHABETA`); **`test.unit.getversion`** covers those fields via **xTests** terse-api assertions; scratch **`libver`** + top-level **`libver.sh`**; * helper scripts: **`.sis/project_name.txt`** / **`.sis/script_info_lines.txt`** wired into **`--help`** and status messages; **run_all_examples.sh**; **run_all_unit_tests.sh** gains **`--unit-only`** / **`--component-only`**; test runners exclude **`*.log`** from discovery; * **bec.file**: create log files without execute permission (was `S_IRWXU`/`S_IRWXG`, which made suite-named logs executable and runnable by test discovery); diff --git a/INSTALL.md b/INSTALL.md index 3987dedd..f7d2761e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -46,7 +46,7 @@ The **prepare_cmake.sh** script has a bunch of command-line flags/options to cus ```plaintext Pantheios is an efficient, flexible, and robust C/C++ diagnostic logging library -Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems +Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems Copyright (c) 2005-2019, Matthew Wilson and Synesis Software Creates/reinitialises the CMake build script(s) @@ -128,7 +128,7 @@ $ sudo cmake --install ${SIS_CMAKE_BUILD_DIR:-./_build} --config Release 1. Download the latest distributions; Obtain the latest releases of **Pantheios** and **STLSoft** from: -* [Pantheios GitHub project](https://github.com/synesissoftware/Pantheios/tags), e.g. [**Pantheios-1.0.1-rc1.zip**](https://github.com/synesissoftware/Pantheios/archive/refs/tags/1.0.1-rc1.zip); +* [Pantheios GitHub project](https://github.com/synesissoftware/Pantheios/tags), e.g. [**Pantheios-1.0.1-rc2.zip**](https://github.com/synesissoftware/Pantheios/archive/refs/tags/1.0.1-rc2.zip); * [STLSoft GitHub project](https://github.com/synesissoftware/STLSoft/tags), e.g. [**STLSoft-1.11.1-rc4**](https://github.com/synesissoftware/STLSoft/archive/refs/tags/STLSoft-1.11.1-rc4); @@ -137,7 +137,7 @@ Obtain the latest releases of **Pantheios** and **STLSoft** from: ```bash $ mkdir -p ~/open-source $ cd ~/open-source -$ unzip Pantheios-1.0.1-rc1.zip +$ unzip Pantheios-1.0.1-rc2.zip $ unzip STLSoft-1.11.1-rc4 ``` @@ -146,7 +146,7 @@ $ unzip STLSoft-1.11.1-rc4 4. Select and change to the appropriate build subdirectory under your **Pantheios** directory, e.g. **build/gcc48.unix**, and then execute make ```bash -$ cd Pantheios-1.0.1-rc1 +$ cd Pantheios-1.0.1-rc2 $ cd build/gcc48.unix $ make ``` @@ -185,8 +185,8 @@ $ make This project comes with a number of scripts useful for building with **CMake**, as follows: -| Script | Purpose | -| ------------------------- | ------- | +| Script | Purpose | +| ------ | ------- | | **build_cmake.sh** | Executes **CMake**-generated artefacts to (re)build project.

Performs a (re)build, meaningful only once `prepare_cmake.sh` has been run once to generate all the **CMake** build artefacts.

Use `./build_cmake.sh --help` for further information. | | **clean_cmake.sh** | Executes **CMake**-generated artefacts to clean project.

Performs a (re)build, meaningful only once `prepare_cmake.sh` has been run once to generate all the **CMake** build artefacts and a build has been run.

Use `./clean_cmake.sh --help` for further information. | | **libver.sh** | Builds (unless suppressed) and runs the **libver** scratch program, which prints composite version macros for **Pantheios** and its discovered dependencies.

Use `./libver.sh --help` for further information. | diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 40c0e6a5..210c1344 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -1,13 +1,13 @@ # Pantheios - Known Issues -## Pantheios 1.0.1-rc1 Known Issues +## Pantheios 1.0.1-rc2 Known Issues * still a few build artefacts not cleaned up for some makefiles; * distribution contains makefiles and project files for obsolete compilers (such as VC++ 5, Comeau, …); -## Pantheios 1.0.1-rc1 Suspected Issues +## Pantheios 1.0.1-rc2 Suspected Issues * \ diff --git a/NEWS.md b/NEWS.md index 2cf4c59d..51dc7b96 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ | Date | News Item | | -------------- | -------------------------------------------------------------------------------- | +| 6th Sep 2026 | [Pantheios 1.0.1-rc2 released](https://github.com/synesissoftware/Pantheios/releases/tag/1.0.1-rc2) | | 5th Aug 2026 | [Pantheios 1.0.1-rc1 released](https://github.com/synesissoftware/Pantheios/releases/tag/1.0.1-rc1) | | 18th Nov 2024 | Pantheios 1.0.1-beta222 released | | 24th Oct 2024 | Pantheios 1.0.1-beta221 released | diff --git a/cmake/pantheios-config.cmake.in b/cmake/pantheios-config.cmake.in index 82620719..a1761369 100644 --- a/cmake/pantheios-config.cmake.in +++ b/cmake/pantheios-config.cmake.in @@ -1,3 +1,77 @@ @PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) + +# ########################################################################## +# Transitive Dependencies +# +# Pantheios builds and exports static library targets +# (Pantheios::Pantheios.core, Pantheios::Pantheios.util, back-ends, +# front-ends, and utilities). +# +# In CMake, private link dependencies of static libraries are exported into +# INTERFACE_LINK_LIBRARIES (wrapped in $) in the generated +# pantheios-targets.cmake file so downstream consumers linking static +# archives can resolve all referenced symbols at final link time. +# +# When downstream consumers call find_package(pantheios), CMake loads +# pantheios-targets.cmake and verifies that any targets named in +# INTERFACE_LINK_LIBRARIES already exist in the imported target namespace. +# If an imported target (e.g. b64::core or STLSoft::STLSoft) has not been +# defined yet, CMake reports a configuration error: +# +# "The link interface of target ... contains: ... but the target was not found." +# +# and the build fails during linking because the linker attempts to resolve +# the target name as a literal file or library flag (e.g. -lb64::core). +# +# Using CMakeFindDependencyMacro's find_dependency() solves this by loading +# cleanly the required imported target definitions while forwarding the +# calling project's QUIET and REQUIRED flags. +# +# Why these calls are strictly CONDITIONAL: +# +# 1. STLSoft (@STLSoft_FOUND@): +# Pantheios public headers and internals depend on STLSoft. When +# Pantheios was configured and built with STLSoft discovered via CMake +# find_package() (@STLSoft_FOUND@ is true), exported targets reference +# STLSoft::STLSoft, and downstream consumers must find that CMake +# package. If STLSoft was provided via a manual include path (e.g. via +# the STLSOFT variable or environment variable without CMake package +# export), @STLSoft_FOUND@ is empty/false and no CMake target dependency +# is exported or required. +# +# 2. b64 (@b64_FOUND@): +# b64 is an OPTIONAL dependency for Pantheios, providing the +# pantheios::b64 inserter class in Pantheios.core. +# - If Pantheios was built WITH b64 (@b64_FOUND@ is true), Pantheios.core +# compiles b64 support and links b64::core. The exported targets file +# therefore requires b64::core in its link interface, and downstream +# consumers must locate b64. +# - If Pantheios was built WITHOUT b64 (e.g. via NO_B64 or because b64 +# was not present at build time), b64 support is omitted and +# pantheios-targets.cmake contains no reference to b64::core. In that +# scenario, calling find_dependency(b64) unconditionally would fail on +# systems where b64 is not installed, needlessly breaking downstream +# consumers. +# +# Guarding with @STLSoft_FOUND@ and @b64_FOUND@ ensures downstream discovery +# precisely mirrors the dependencies linked into the installed Pantheios +# binary. +# ########################################################################## + +if(@STLSoft_FOUND@) + + find_dependency(STLSoft) +endif() + +if(@b64_FOUND@) + + find_dependency(b64) +endif() + include("${CMAKE_CURRENT_LIST_DIR}/@EXPORT_NAME@-targets.cmake") + +# ############################## end of file ############################# # + diff --git a/include/pantheios/pantheios.h b/include/pantheios/pantheios.h index 0c367acf..373391d8 100644 --- a/include/pantheios/pantheios.h +++ b/include/pantheios/pantheios.h @@ -4,7 +4,7 @@ * Purpose: Pantheios Core and Util APIs. * * Created: 21st June 2005 - * Updated: 5th August 2026 + * Updated: 6th September 2026 * * Home: http://www.pantheios.org/ * @@ -118,13 +118,14 @@ # endif # define PANTHEIOS_VER_1_0_1_B224 0x010001e0 # define PANTHEIOS_VER_1_0_1_RC1 0x010001e1 /* NOTE: e1 is required just to step over the prior 1.0.1 beta version values */ +# define PANTHEIOS_VER_1_0_1_RC2 0x010001e2 # define PANTHEIOS_VER_1_0_1 0x010001ff #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */ #define PANTHEIOS_VER_MAJOR 1 #define PANTHEIOS_VER_MINOR 0 #define PANTHEIOS_VER_PATCH 1 -#define PANTHEIOS_VER_ALPHABETA 0xE1 +#define PANTHEIOS_VER_ALPHABETA 0xE2 #define PANTHEIOS_VER \ (0\ diff --git a/projects/core/CMakeLists.txt b/projects/core/CMakeLists.txt index b802b1f9..b2cf817b 100644 --- a/projects/core/CMakeLists.txt +++ b/projects/core/CMakeLists.txt @@ -36,10 +36,16 @@ target_include_directories(Pantheios.core target_link_STLSoft(Pantheios.core) -target_link_libraries(Pantheios.core - PRIVATE - $<$: b64::core > -) +# Link b64 only when discovered at configure time. Prefer a plain +# target_link_libraries() over a generator expression so the exported +# interface records `$` cleanly (static lib). +if(b64_FOUND) + + target_link_libraries(Pantheios.core + PRIVATE + b64::core + ) +endif(b64_FOUND) define_target_compile_options(Pantheios.core) diff --git a/test/unit/test.unit.getversion/test.unit.getversion.c b/test/unit/test.unit.getversion/test.unit.getversion.c index 79f70892..f888a7b3 100644 --- a/test/unit/test.unit.getversion/test.unit.getversion.c +++ b/test/unit/test.unit.getversion/test.unit.getversion.c @@ -4,7 +4,7 @@ * Purpose: Implementation file for the test.unit.getversion project. * * Created: 28th August 2008 - * Updated: 4th August 2026 + * Updated: 6th September 2026 * * ////////////////////////////////////////////////////////////////////// */ @@ -151,7 +151,7 @@ static void test_composite(void) TEST_INT_EQ(expected, PANTHEIOS_VER); TEST_INT_EQ(expected, pantheios_getVersion()); - TEST_INT_EQ(PANTHEIOS_VER_1_0_1_RC1, PANTHEIOS_VER); + TEST_INT_EQ(PANTHEIOS_VER_1_0_1_RC2, PANTHEIOS_VER); }