From b4491c1072b7a3e09c4d64041be16a311743e00c Mon Sep 17 00:00:00 2001 From: selsta Date: Thu, 29 Jun 2023 22:53:07 +0200 Subject: [PATCH] cmake: set -fno-aligned-allocation on macOS ARM We set a deployment target that is lower than 10.14, which means we have to disable aligned allocation otherwise compilation fails. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e5f5b48c..99baba2ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -999,6 +999,9 @@ else() if(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -DGTEST_HAS_TR1_TUPLE=0") + if(ARM) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-aligned-allocation") + endif() endif() set(DEBUG_FLAGS "-g3")