Skip to content

Modernize CMake packaging, benchmark dependencies, and CI - #6

Merged
rigtorp merged 3 commits into
masterfrom
build/modernize-cmake
Oct 4, 2026
Merged

rigtorp merged 3 commits into
masterfrom
build/modernize-cmake

Conversation

@rigtorp

@rigtorp rigtorp commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

HashMap currently builds all executables in standalone builds and infers optional benchmark dependencies from header availability. This can include Abseil headers without linking its libraries. The repository also tracks an unused Google Benchmark gitlink without a .gitmodules entry.

Add independent options for tests, examples, benchmarks, installation, and warnings as errors. Standalone defaults retain the current executables; embedded builds default to the header-only HashMap::HashMap target. Keep warnings and benchmark dependencies private to executables, honor BUILD_TESTING, and select optional Abseil/sparsehash comparisons through CMake detection and explicit definitions. Windows continues to omit the POSIX benchmark.

Generate separate package configuration, targets, and architecture-independent version files. Respect custom installation directories and support build-tree and relocated installed consumers. Document configuration and consumption. Remove the unused Google Benchmark gitlink; the benchmark continues to use steady_clock without downloading dependencies.

Replace the push-only legacy CI with pull-request and master-push coverage for Linux GCC/Clang, macOS Clang, and Windows MSVC. Keep sanitizer checks on Linux/macOS and test the C++14 library requirement. Pin checkout v7.0.1, use read-only permissions, cancel superseded runs, set timeouts, and separate configure/build/test steps. Each job runs the reusable embedded, build-tree, installed, and relocated CMake consumer checks.

Validation:

  • GCC 16.2.1 Release and Clang 22.1.8 Debug builds and CTest passed with warnings as errors; Clang also passed ASan/UBSan.
  • GCC Release build and both CTests passed again in the isolated PR worktree.
  • C++14 consumers passed with add_subdirectory, the build-tree package, a default installation, and a relocated installation with custom include/library directories. Verified embedded defaults create no executables and propagate no warning options.
  • Library-only configuration and BUILD_TESTING=OFF passed.
  • Built with installed Abseil 20260817.0 and sparsehash 2.0.4; CTest and a sparsehash benchmark smoke run passed. Disabling both optional comparisons also built and ran successfully with those dependencies installed.
  • git diff --check passed.
  • actionlint passed. The new CMake consumer check script passed locally with GCC and Clang; the workflow's C++14 Clang sanitizer build and CTest passed.
  • Updated pull-request CI passes on Linux GCC, Linux Clang, macOS Clang, and Windows MSVC, including all four package consumer checks on each platform.

@rigtorp rigtorp changed the title Modernize CMake packaging and remove unused benchmark vendoring Modernize CMake packaging, benchmark dependencies, and CI Oct 4, 2026
@rigtorp
rigtorp merged commit 5980caf into master Oct 4, 2026
4 checks passed
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