mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
cmake: Update macOS compiler configuration
Compiler extensions are disabled before the first `project` call to force CMake into considering compilers to not support GNU extensions (even though clang and gcc do). Also sets common clang compiler options so they can be used across all supported platforms. `openmp-simd` support is enabled by default as there is no performance penalty on x86_64 systems and intrinsics are enabled on arm64. Also implements CMake's `CMAKE_COMPILE_WARNING_AS_ERROR` flag to enable the desired behavior and configuration time.
This commit is contained in:
@@ -43,7 +43,7 @@ set_target_properties(
|
||||
XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--timestamp"
|
||||
XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET 13.0
|
||||
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.obsproject.obs-studio.mac-camera-extension"
|
||||
XCODE_ATTRIBUTE_SWIFT_VERSION 5
|
||||
XCODE_ATTRIBUTE_SWIFT_VERSION 5.0
|
||||
XCODE_ATTRIBUTE_SKIP_INSTALL YES)
|
||||
|
||||
set_target_properties_obs(mac-camera-extension PROPERTIES FOLDER plugins
|
||||
|
||||
@@ -6,11 +6,10 @@ add_library(mac-virtualcam MODULE)
|
||||
add_library(OBS::virtualcam ALIAS mac-virtualcam)
|
||||
|
||||
target_sources(mac-virtualcam PRIVATE Defines.h plugin-main.mm OBSDALMachServer.mm OBSDALMachServer.h)
|
||||
target_compile_options(mac-virtualcam PRIVATE -fmodules -fcxx-modules)
|
||||
|
||||
if(XCODE)
|
||||
target_compile_options(mac-virtualcam PRIVATE -fmodules -fcxx-modules)
|
||||
else()
|
||||
target_compile_options(mac-virtualcam PRIVATE -fobjc-arc -fobjc-weak -fmodules -fcxx-modules)
|
||||
if(NOT XCODE)
|
||||
target_compile_options(mac-virtualcam PRIVATE -fobjc-arc -fobjc-weak)
|
||||
endif()
|
||||
|
||||
target_link_libraries(mac-virtualcam PRIVATE OBS::mach-protocol OBS::libobs OBS::frontend-api)
|
||||
|
||||
Reference in New Issue
Block a user