Skip to content

Prepare CMake build for vcpkg packaging#157

Merged
gafferongames merged 2 commits into
mainfrom
vcpkg-packaging
Jul 11, 2026
Merged

Prepare CMake build for vcpkg packaging#157
gafferongames merged 2 commits into
mainfrom
vcpkg-packaging

Conversation

@gafferongames

@gafferongames gafferongames commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Prepares netcode for a port in the microsoft/vcpkg registry, ahead of the next release (v1.3.3, project version already bumped in #155).

  • Only default CMAKE_MSVC_RUNTIME_LIBRARY to the static CRT when the integrator hasn't set it. vcpkg validates that installed libraries match the triplet's CRT linkage (dynamic on x64-windows), so the hardcoded static runtime would fail its post-build checks. Regular builds are unchanged — the static-CRT default still applies whenever nothing else sets it.
  • Add NETCODE_BUILD_TESTS (defaults ON at top level, following the serialize pattern) so package builds can skip the client/server/soak/profile/test executables that never get installed.
  • Add NETCODE_VERSION_FULL and NETCODE_VERSION_MAJOR/MINOR/PATCH macros to netcode.h — netcode had no version macros — matching the convention reliable follows, and extend the release check workflow from Add release version check workflow #156 to verify the macros agree with each other, with the CMake project version, and with the release tag.

Verified locally: builds and passes tests with the option ON, builds the library alone with it OFF, and the vcpkg overlay port for netcode (built with NETCODE_SYSTEM_SODIUM=ON against vcpkg's libsodium) builds against this branch and passes vcpkg post-build validation on arm64-osx.

🤖 Generated with Claude Code

gafferongames and others added 2 commits July 11, 2026 13:17
Two changes needed to package netcode in the vcpkg registry, plus a
version fix:

- Only default CMAKE_MSVC_RUNTIME_LIBRARY to the static CRT when the
  integrator hasn't set it. vcpkg validates that installed libraries
  match the triplet's CRT linkage (dynamic on x64-windows), so the
  hardcoded static runtime would fail its post-build checks.

- Add NETCODE_BUILD_TESTS (defaults ON at top level, following the
  serialize pattern) so package builds can skip the example, soak,
  profile and test executables that never get installed.

- Bump the CMake project version to 1.3.3: v1.3.2 was tagged with the
  project version still reporting 1.3.1, the same missed bump that
  reliable v1.3.2 shipped with.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
netcode.h now reports its version via NETCODE_VERSION_FULL and
NETCODE_VERSION_MAJOR/MINOR/PATCH, matching the convention reliable
follows. The release check workflow now verifies the header macros
agree with each other, with the CMake project version, and with the
release tag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gafferongames gafferongames merged commit c9d90d6 into main Jul 11, 2026
12 checks passed
@gafferongames gafferongames deleted the vcpkg-packaging branch July 11, 2026 17:33
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