diff --git a/CHANGELOG.md b/CHANGELOG.md index 39fb69b..95aa55d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.3] - 2026-06-16 + +### Changed + +- 发布二进制体积缩小约 44%(~4.0MB → ~2.25MB):链接启用 `--gc-sections` + 丢弃静态链入 iceoryx/CycloneDDS 中未引用的代码,Release 默认 `-Os`。 +- 发布时分离调试符号:发布的 bin 经 strip 并通过 `--add-gnu-debuglink` + 关联符号档,符号包仅作为 CI artifact 上传,不挂公开 Release。 + +### Fixed + +- `--version` 不再硬编码:版本号统一以 CMake `project(VERSION)` 为唯一来源, + 注入给 CLI,避免发布版本与二进制自报版本不一致。 + ## [0.0.2] - 2025-03-09 ### Added diff --git a/CMakeLists.txt b/CMakeLists.txt index 869b27e..39e898a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(cddsctl VERSION 0.0.2 LANGUAGES C CXX) +project(cddsctl VERSION 0.0.3 LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 94e9828..6483264 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -13,6 +13,10 @@ target_include_directories(cddsctl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) +# Single source of truth for the CLI version: project(VERSION) in the top-level +# CMakeLists, injected so main.cpp doesn't carry its own copy. +target_compile_definitions(cddsctl PRIVATE CDDSCTL_VERSION="${PROJECT_VERSION}") + target_link_libraries(cddsctl PRIVATE cddsctl_recorder optionparser diff --git a/cli/main.cpp b/cli/main.cpp index ce43a62..6f3d4c3 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -14,7 +14,7 @@ namespace { -constexpr const char* VERSION = "0.0.2"; +constexpr const char* VERSION = CDDSCTL_VERSION; constexpr const char* SHM_STATUS = "with SHM";