build: macOS universal binary (arm64+x86_64) with deployment target 11.0
- Set CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_ARCHITECTURES before project() so they propagate to all FetchContent dependencies (SDL3, etc.) - build.sh: native mac release builds universal binary, detects and rebuilds single-arch libsodium, verifies with lipo, exports MACOSX_DEPLOYMENT_TARGET; dev build uses correct build/mac directory - fetch-libsodium.sh: build arm64 and x86_64 separately then merge with lipo on native macOS; fix sha256sum unavailable on macOS (use shasum)
This commit is contained in:
@@ -3,6 +3,17 @@
|
||||
# Released under the GPLv3
|
||||
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# macOS: set deployment target and universal architectures BEFORE project()
|
||||
# so they propagate to all targets, including FetchContent dependencies (SDL3, etc.)
|
||||
if(APPLE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum macOS version" FORCE)
|
||||
# Build universal binary (Apple Silicon + Intel) unless the user explicitly set architectures
|
||||
if(NOT DEFINED CMAKE_OSX_ARCHITECTURES OR CMAKE_OSX_ARCHITECTURES STREQUAL "")
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "macOS architectures" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
project(ObsidianDragon
|
||||
VERSION 1.1.1
|
||||
LANGUAGES C CXX
|
||||
|
||||
Reference in New Issue
Block a user