<feed xmlns='http://www.w3.org/2005/Atom'>
<title>SpaghettiKart/cmake/TorchExternalFixes.cmake, branch main</title>
<subtitle>SpaghettiKart: Mario Kart 64 PC port</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/SpaghettiKart/'/>
<entry>
<title>Fix macOS arm64 build: fmt consteval error in the TorchExternal sub-build (#712)</title>
<updated>2026-07-17T22:28:29+00:00</updated>
<author>
<name>quarrel07</name>
<email>quarrel-07atolls@icloud.com</email>
</author>
<published>2026-07-17T22:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/SpaghettiKart/commit/?id=6ed9a8ad288aebd6438af924e2de9f4061f99fb9'/>
<id>6ed9a8ad288aebd6438af924e2de9f4061f99fb9</id>
<content type='text'>
* Fix macOS arm64 build: fmt consteval error in the TorchExternal sub-build

Torch's pinned spdlog bundles an fmt whose consteval format-string
checking fails to compile under newer AppleClang (Xcode 16+), breaking
the build-macos-arm64 CI job (the intel runner's older Xcode doesn't hit
it):

  error: call to consteval function 'fmt::basic_format_string&lt;...&gt;' is
  not a constant expression

Define FMT_CONSTEVAL as empty inside the Torch sub-build, falling back to
fmt's pre-C++20 constexpr checking. Injected via CMAKE_PROJECT_INCLUDE
because Torch's CMakeLists overwrites CMAKE_CXX_FLAGS, so plain flag
injection through CMAKE_ARGS is discarded. Scoped to AppleClang; no other
platform or compiler is affected, and the Torch pin is unchanged.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;

* Also neutralize FMT_CONSTEVAL for the game build (vcpkg spdlog/fmt)

With the TorchExternal fix in place, CI reaches the game build and hits
the same consteval error again, this time from the vcpkg-provided
spdlog/fmt headers (SPDLOG_FMT_EXTERNAL) under the runner's Xcode 26.5.
Apply the same AppleClang-scoped FMT_CONSTEVAL= define at the project
level so both layers compile.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;

* Pin vcpkg fmt to 10.2.1 (+ spdlog 1.14.1): fmt 11.0.2 can't compile on new AppleClang

The baseline's fmt 11.0.2 both fails to compile under newer AppleClang
(consteval format-string checking) and removed the #ifndef guard around
FMT_CONSTEVAL, so the AppleClang-scoped define from the previous commit
lands on the compile line but gets clobbered by fmt's own definition
(FMT_USE_CONSTEVAL is likewise unguarded in that version). No newer fmt
exists in the pinned baseline.

Override fmt to 10.2.1, which keeps the #ifndef guard, making the
existing define effective; spdlog moves to the matching 1.14.1 (1.15.x
requires fmt &gt;= 11 headers).

Verified locally against the exact CI setup (vcpkg at baseline
2e58bb35ff, vcpkg toolchain file, Ninja): the previous failure reproduces
without this change and the full game builds cleanly with it.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;

* Add TODO markers for removing the fmt consteval workarounds

Requested in PR #712 review: mark all three workaround sites (project-level
define, Torch sub-build include, vcpkg fmt/spdlog pins) so they can be found
and removed together once the Torch pin is bumped past its spdlog/fmt update.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;

---------

Co-authored-by: siliconports &lt;aguthmann10@gmail.com&gt;
Co-authored-by: Claude Fable 5 &lt;noreply@anthropic.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix macOS arm64 build: fmt consteval error in the TorchExternal sub-build

Torch's pinned spdlog bundles an fmt whose consteval format-string
checking fails to compile under newer AppleClang (Xcode 16+), breaking
the build-macos-arm64 CI job (the intel runner's older Xcode doesn't hit
it):

  error: call to consteval function 'fmt::basic_format_string&lt;...&gt;' is
  not a constant expression

Define FMT_CONSTEVAL as empty inside the Torch sub-build, falling back to
fmt's pre-C++20 constexpr checking. Injected via CMAKE_PROJECT_INCLUDE
because Torch's CMakeLists overwrites CMAKE_CXX_FLAGS, so plain flag
injection through CMAKE_ARGS is discarded. Scoped to AppleClang; no other
platform or compiler is affected, and the Torch pin is unchanged.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;

* Also neutralize FMT_CONSTEVAL for the game build (vcpkg spdlog/fmt)

With the TorchExternal fix in place, CI reaches the game build and hits
the same consteval error again, this time from the vcpkg-provided
spdlog/fmt headers (SPDLOG_FMT_EXTERNAL) under the runner's Xcode 26.5.
Apply the same AppleClang-scoped FMT_CONSTEVAL= define at the project
level so both layers compile.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;

* Pin vcpkg fmt to 10.2.1 (+ spdlog 1.14.1): fmt 11.0.2 can't compile on new AppleClang

The baseline's fmt 11.0.2 both fails to compile under newer AppleClang
(consteval format-string checking) and removed the #ifndef guard around
FMT_CONSTEVAL, so the AppleClang-scoped define from the previous commit
lands on the compile line but gets clobbered by fmt's own definition
(FMT_USE_CONSTEVAL is likewise unguarded in that version). No newer fmt
exists in the pinned baseline.

Override fmt to 10.2.1, which keeps the #ifndef guard, making the
existing define effective; spdlog moves to the matching 1.14.1 (1.15.x
requires fmt &gt;= 11 headers).

Verified locally against the exact CI setup (vcpkg at baseline
2e58bb35ff, vcpkg toolchain file, Ninja): the previous failure reproduces
without this change and the full game builds cleanly with it.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;

* Add TODO markers for removing the fmt consteval workarounds

Requested in PR #712 review: mark all three workaround sites (project-level
define, Torch sub-build include, vcpkg fmt/spdlog pins) so they can be found
and removed together once the Torch pin is bumped past its spdlog/fmt update.

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;

---------

Co-authored-by: siliconports &lt;aguthmann10@gmail.com&gt;
Co-authored-by: Claude Fable 5 &lt;noreply@anthropic.com&gt;</pre>
</div>
</content>
</entry>
</feed>
