diff options
author | Vadim-Valdis Yudaev <judaew@outlook.de> | 2021-12-13 23:32:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 13:32:58 -0800 |
commit | 8dcd2682c7596ac0e5c4fe5cf46298f7148f447c (patch) | |
tree | 54095f64d07b6c44b7b4a1ca08f4f0c53f42dcf3 /CMakeLists.txt | |
parent | b78002ff3edf55527ad550dbf0eb1b2717264f8e (diff) | |
download | flatbuffers-8dcd2682c7596ac0e5c4fe5cf46298f7148f447c.tar.gz flatbuffers-8dcd2682c7596ac0e5c4fe5cf46298f7148f447c.tar.bz2 flatbuffers-8dcd2682c7596ac0e5c4fe5cf46298f7148f447c.zip |
[CMake] Add option for disable universal on OSX (#6990)
See https://github.com/google/flatbuffers/issues/6988
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fc20b7d..ea0a42e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,9 @@ option(FLATBUFFERS_ENABLE_PCH option(FLATBUFFERS_SKIP_MONSTER_EXTRA "Skip generating monster_extra.fbs that contains non-supported numerical\" types." OFF) +option(FLATBUFFERS_OSX_BUILD_UNIVERSAL + "Enable the build for multiple architectures on OS X (arm64, x86_64)." + ON) if(NOT FLATBUFFERS_BUILD_FLATC AND FLATBUFFERS_BUILD_TESTS) message(WARNING @@ -282,8 +285,11 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") if(APPLE) - set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + + if(FLATBUFFERS_OSX_BUILD_UNIVERSAL) + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") + endif() else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") endif() |