Skip to content

Modernize CMake build system - #402

Merged
PJK merged 4 commits into
masterfrom
modernize-cmake
Feb 8, 2026
Merged

PJK merged 4 commits into
masterfrom
modernize-cmake

Conversation

@PJK

@PJK PJK commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Use project(VERSION 0.13.0 ...) instead of manual set(CBOR_VERSION_*) variables
  • Replace global add_definitions() with target-scoped target_compile_definitions() (PRIVATE for internal-only defines, PUBLIC for defines used in public headers)
  • Remove redundant include_directories(src) (already handled by target_include_directories in src/CMakeLists.txt)
  • Remove deprecated CBOR_CUSTOM_ALLOC option (was a no-op with deprecation warning since 0.10.0)
  • Simplify LTO version check to VERSION_GREATER_EQUAL

Test plan

  • Clean configure + build with -DWITH_TESTS=ON -DSANITIZE=ON succeeds
  • All 26 tests pass
  • Generated configuration.h has correct version numbers
  • Generated libcbor.pc has correct version
  • No add_definitions remain in CMakeLists.txt
  • CI passes (Linux GCC, Linux Clang, MSVC, 32-bit, ARM, FreeBSD)

🤖 Generated with Claude Code

PJK and others added 4 commits February 8, 2026 21:05
Use project(VERSION ...) instead of manual version variables, replace
global add_definitions() with target-scoped target_compile_definitions(),
remove redundant include_directories(src), remove deprecated
CBOR_CUSTOM_ALLOC option, and simplify LTO version check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PJK
PJK merged commit 5cd0bad into master Feb 8, 2026
15 of 16 checks passed
@PJK
PJK deleted the modernize-cmake branch February 8, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址