Skip to content

fix: upgrade nlohmann/json to v3.12.0 for CMake 4 compatibility - #272

Closed
BeiBaiNian wants to merge 1 commit into
apache:masterfrom
BeiBaiNian:fix-upgrade-nlohmann-json
Closed

fix: upgrade nlohmann/json to v3.12.0 for CMake 4 compatibility#272
BeiBaiNian wants to merge 1 commit into
apache:masterfrom
BeiBaiNian:fix-upgrade-nlohmann-json

Conversation

@BeiBaiNian

Copy link
Copy Markdown
Contributor

Why

The Windows CI job (build (windows-latest, 3.12) in python_binding.yml) fails at the "Build and install" step with:

CMake Error at build/temp.win-amd64-cpython-312/Release/_deps/json-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

The Windows runner ships a recent CMake (4.x), which removed compatibility with cmake_minimum_required(VERSION < 3.5). The pinned nlohmann/json v3.11.2 declares cmake_minimum_required(VERSION 3.1), so CMake 4.x rejects it while configuring the FetchContent dependency. The Ubuntu job is unaffected because its CMake is still 3.x.

What changed

  • cmake/modules/Findjson.cmake: bump the FetchContent GIT_TAG of nlohmann/json from v3.11.2 to v3.12.0. v3.12.0 declares cmake_minimum_required(VERSION 3.5...4.0), which is accepted by CMake 4.x.

Verification

  • Reproduced the CI failure locally with CMake 4.4.2 + json v3.11.2: same error as the Windows CI log.
  • With json v3.12.0 + CMake 4.4.2: cmake configure succeeds, and mingw32-make casbin builds libcasbin.a successfully.
  • Only 1 file changed; the fix is limited to the dependency version bump.

@BeiBaiNian
BeiBaiNian force-pushed the fix-upgrade-nlohmann-json branch from 36ecc0c to ff185d5 Compare August 7, 2026 04:02
@BeiBaiNian BeiBaiNian closed this Aug 7, 2026
@BeiBaiNian
BeiBaiNian deleted the fix-upgrade-nlohmann-json branch August 7, 2026 04:48
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