Merge pull request #64 from r-burns/darwin-objc-flags

Apply -fno-objc-exceptions flag for ObjC sources only
This commit is contained in:
David Liu 2020-12-04 00:37:24 -05:00 committed by GitHub
commit 04eb363df3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -305,10 +305,9 @@ 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("$<$<COMPILE_LANGUAGE:OBJC>:-fno-objc-exceptions>")
add_compile_options("$<$<COMPILE_LANGUAGE:OBJCXX>:-fno-objc-exceptions>")
dolphin_compile_definitions(FMT_EXCEPTIONS=0)
find_library(APPKIT_LIBRARY AppKit)
find_library(APPSERV_LIBRARY ApplicationServices)