CMake: Fix build errors exposed by making common dependent on fmt

This commit is contained in:
JosJuice
2020-10-14 20:50:38 +02:00
parent 1084cfec1a
commit cb14b65aad
5 changed files with 19 additions and 1 deletions

View File

@ -308,6 +308,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
# Drop unreachable code and data.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs")
# 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)
find_library(APPKIT_LIBRARY AppKit)
find_library(APPSERV_LIBRARY ApplicationServices)
find_library(CARBON_LIBRARY Carbon)