mirror of
https://codeberg.org/wownero/wownero.git
synced 2026-10-17 05:41:49 +02:00
build: C++17 + -fno-aligned-allocation for macOS (C++17 aligned new needs 10.14; keep older deployment target)
This commit is contained in:
+8
-1
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user