build: C++17 + -fno-aligned-allocation for macOS (C++17 aligned new needs 10.14; keep older deployment target)

This commit is contained in:
jwinterm
2026-06-18 07:50:09 -04:00
parent c85fa8655f
commit bcf3973d3e
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -96,10 +96,17 @@ enable_language(C ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(APPLE)
# C++17 aligned new/delete (std::align_val_t) require macOS deployment target >= 10.14. The depends
# macOS toolchain targets older (and Apple Silicon aarch64 cross-builds hit this on boost/any.hpp).
# Disable aligned allocation so wownero builds under C++17 on all macOS targets.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-aligned-allocation")
endif()
function (die msg)
if (NOT WIN32)
string(ASCII 27 Esc)
+1 -1
View File
@@ -6,7 +6,7 @@ else
CC_target=$(host)
endif
darwin_CC=clang -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -mlinker-version=$(LD64_VERSION) -B$(host_prefix)/native/bin/$(host)-
darwin_CXX=clang++ -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -B$(host_prefix)/native/bin/$(host)-
darwin_CXX=clang++ -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(host_prefix)/native/SDK/ -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -fno-aligned-allocation -B$(host_prefix)/native/bin/$(host)-
darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)