libplatform: use ObjC flags on Apple

This commit is contained in:
Sergey Fedorov 2024-12-07 19:02:23 +08:00
parent 653e4badeb
commit fe46de9053
1 changed files with 5 additions and 0 deletions

View File

@ -46,4 +46,9 @@ endif()
if (APPLE) if (APPLE)
find_library(COCOA_LIBRARY Cocoa) find_library(COCOA_LIBRARY Cocoa)
target_link_libraries(platform ${COCOA_LIBRARY}) target_link_libraries(platform ${COCOA_LIBRARY})
target_compile_options(platform PRIVATE
$<$<COMPILE_LANGUAGE:C>:-fobjc-exceptions>
$<$<COMPILE_LANGUAGE:C>:-xobjective-c>
$<$<COMPILE_LANGUAGE:CXX>:-fobjc-exceptions>
)
endif() endif()