Update build requirements for Apple

CMake version 3.20 or higher (needed to support Xcode project generation)
clang version 12.0 or higher (needed to support arm64+x64 universal binary compilation)
XCode 12.2 is the oldest version which includes clang version 12.0
This commit is contained in:
Jake Turner
2022-02-19 11:17:33 +00:00
committed by Baldur Karlsson
parent 08e7a55732
commit 39d11975b2
3 changed files with 19 additions and 2 deletions
+9
View File
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 2.8.12)
if(APPLE)
# Building for Apple requires at least CMake 3.20.0
cmake_minimum_required(VERSION 3.20.0)
SET(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build architectures for Mac OS X" FORCE)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum SDK for Mac OS X" FORCE)
SET(CMAKE_XCODE_GENERATE_SCHEME ON)
@@ -194,6 +197,12 @@ option(ENABLE_ASAN "Enable address sanitizer" OFF)
option(ENABLE_TSAN "Enable thread sanitizer" OFF)
option(ENABLE_MSAN "Enable memory sanitizer" OFF)
if(APPLE)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
message(FATAL_ERROR "Xcode 12.2 or newer is required to build for Apple")
endif()
endif()
if(ENABLE_ASAN)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
message(STATUS "Enabling address sanitizer - may cause issues if capturing, only recommended for use with replay only")
+9 -1
View File
@@ -27,7 +27,15 @@ Configuration is available for cmake, [documented elsewhere](https://cmake.org/d
First check that you have all of the [required dependencies](Dependencies.md#mac).
Mac support is pretty early and while it will compile, it's not usable for debugging yet and is not officially supported. Builds happen with cmake the same way as Linux.
Mac support is pretty early and while it will compile, it's not usable for debugging yet and is not officially supported.
To build with make, use cmake the same way as Linux.
To build with Xcode, use the cmake Xcode generator to create the Xcode project:
```
cmake -DCMAKE_BUILD_TYPE=Debug -Bbuild -H. -GXcode
```
## Android
+1 -1
View File
@@ -95,7 +95,7 @@ sudo apt-get install libx11-dev libx11-xcb-dev mesa-common-dev libgl1-mesa-dev l
## Mac
Mac requires a recent version of CMake, and the same Qt version as the other platforms (at least 5.6.2). If you're using [homebrew](http://brew.sh) then this will do the trick:
Mac requires Xcode version 12.2 or newer, CMake version 3.20 or newer, and Qt5 version 5.15.2 or newer. If you're using [homebrew](http://brew.sh) then this will do the trick:
```
brew install cmake qt5