Skip to content

Commit

Permalink
Added options for OSX universal binary in cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
janmalec committed Oct 31, 2023
1 parent 5852afb commit dee250a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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})
Expand Down

0 comments on commit dee250a

Please sign in to comment.