From a8f78b2d549744b4f1b696f2bf05cf3d1bce31b0 Mon Sep 17 00:00:00 2001 From: majiayu000 <1835304752@qq.com> Date: Thu, 8 Jan 2026 17:45:16 +0800 Subject: [PATCH] build: use C++17 standard for macOS compatibility Modern Apple SDK headers (macOS 26+, Xcode 17+) require elaborated enum base declarations which are not supported in C++11. This causes compilation failures with errors like: "non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration" Setting CMAKE_CXX_STANDARD to 17 resolves this issue while maintaining backward compatibility with other platforms. Fixes #350 Signed-off-by: majiayu000 <1835304752@qq.com> --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c8382e34..fc90e187c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,10 @@ option(BITNET_ARM_TL1 "bitnet.cpp: use tl1 on arm platform" OFF) option(BITNET_X86_TL2 "bitnet.cpp: use tl2 on x86 platform" OFF) +# Use C++17 to support modern Apple SDK headers which require elaborated enum base +# declarations not available in C++11. This fixes compilation on macOS with +# recent Xcode/AppleClang versions. See issue #350. +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED true) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED true)