mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-21 16:01:55 -04:00
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.
23 lines
695 B
CMake
23 lines
695 B
CMake
# OBS CMake ccache module
|
|
|
|
include_guard(GLOBAL)
|
|
|
|
if(NOT DEFINED CCACHE_PROGRAM)
|
|
message(DEBUG "Trying to find ccache on build host...")
|
|
find_program(CCACHE_PROGRAM "ccache")
|
|
mark_as_advanced(CCACHE_PROGRAM)
|
|
endif()
|
|
|
|
if(CCACHE_PROGRAM)
|
|
message(DEBUG "Ccache found as ${CCACHE_PROGRAM}...")
|
|
option(ENABLE_CCACHE "Enable compiler acceleration with ccache" ON)
|
|
|
|
if(ENABLE_CCACHE)
|
|
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
|
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
|
set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
|
set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
|
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
|
|
endif()
|
|
endif()
|