From dee250af1809909bb759b4381595a5a489fe5690 Mon Sep 17 00:00:00 2001 From: Jan Malec Date: Tue, 31 Oct 2023 09:03:48 +0100 Subject: [PATCH] Added options for OSX universal binary in cmake --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1f2ef1..642c932 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,11 @@ if(APPLE AND NANOGUI_BUILD_SHARED) set(CMAKE_MACOSX_RPATH ON) endif() +# set CMAKE_OS_ARCHITECTURES to get unversal binary on macOS +if(APPLE) + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +endif() + include(CheckCXXCompilerFlag) include(CheckCXXSourceRuns) @@ -287,7 +292,7 @@ endif() if (APPLE) # Use automatic reference counting for Objective-C portions - add_compile_options(-fobjc-arc) + # add_compile_options(-fobjc-arc) endif() add_definitions(${NANOGUI_EXTRA_DEFS})