Skip to content

SagePatch: pin target to C++17 so macOS builds#180

Merged
fbraz3 merged 1 commit into
fbraz3:mainfrom
mohamedelabbas1996:fix/sagepatch-cxx17
Jun 28, 2026
Merged

SagePatch: pin target to C++17 so macOS builds#180
fbraz3 merged 1 commit into
fbraz3:mainfrom
mohamedelabbas1996:fix/sagepatch-cxx17

Conversation

@mohamedelabbas1996

Copy link
Copy Markdown

Problem

Building sage_patch on macOS fails with:

error: scoped enumerations are a C++11 extension [-Wc++11-extensions]
error: expected ';' at end of declaration    (SDL_Rect bounds{};)

The sage_patch sources use modern C++ (scoped enums, brace-init), but the target sets no C++ standard, so it inherits the engine's global C++98. A standards-strict compiler (AppleClang) then rejects the C++11/17 constructs and the macOS build breaks.

Fix

Pin the sage_patch target to C++17 (independent of the legacy engine's standard):

set_target_properties(sage_patch PROPERTIES
    CXX_STANDARD 17
    CXX_STANDARD_REQUIRED ON
)

One-line behavior change, scoped to the sage_patch target only. Verified: the macOS z_generals build links cleanly with this in place.

🤖 Generated with Claude Code

The sage_patch sources use modern C++ (scoped enums, brace-init), but the
target sets no C++ standard and inherits the engine's global C++98. With a
standards-strict compiler (AppleClang) this fails:
  error: scoped enumerations are a C++11 extension
Pin sage_patch to CXX_STANDARD 17 so it builds on macOS.
@fbraz3 fbraz3 merged commit 1f10a68 into fbraz3:main Jun 28, 2026
6 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.

2 participants