From 7c8576085aa66761c84afd377eb36ecef67cfbe6 Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Thu, 3 Dec 2020 18:43:10 -0800 Subject: [PATCH 1/2] Apply -fno-objc-exceptions flag for ObjC sources only --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6cc003c17..17f108fc32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,10 +305,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") # Set -fno-objc-exceptions, for consistency with -fno-exceptions earlier. # If we set only -fno-exceptions, fmt fails to compile when included from # Objective-C++ because fmt tries try to use throw because __EXCEPTIONS is defined. - # - # TODO: Only enable this for Objective-C(++). - # We get warnings if we enable this when building regular C(++) code. - check_and_add_flag(NO_OBJC_EXCEPTIONS -fno-objc-exceptions) + add_compile_options("$<$:-fno-objc-exceptions>") + add_compile_options("$<$:-fno-objc-exceptions>") find_library(APPKIT_LIBRARY AppKit) find_library(APPSERV_LIBRARY ApplicationServices) From 547c3a68050f6e566fd929142090143092548b9c Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Thu, 3 Dec 2020 19:30:42 -0800 Subject: [PATCH 2/2] Disable fmt exceptions --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17f108fc32..f61c809abe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -307,6 +307,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") # Objective-C++ because fmt tries try to use throw because __EXCEPTIONS is defined. add_compile_options("$<$:-fno-objc-exceptions>") add_compile_options("$<$:-fno-objc-exceptions>") + dolphin_compile_definitions(FMT_EXCEPTIONS=0) find_library(APPKIT_LIBRARY AppKit) find_library(APPSERV_LIBRARY ApplicationServices)