Add an option to disable the use of internal Clang compiler

This commit is contained in:
Kirill Kirilenko 2022-09-14 20:58:03 +03:00
parent ab22b5519e
commit 1e24732035
2 changed files with 7 additions and 4 deletions

View file

@ -4,6 +4,7 @@ set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING INTERNAL FORCE)
project(libwebrtc) project(libwebrtc)
set(USE_CLANG ON CACHE BOOL "Build using internal Clang compiler (set to OFF to build using system GCC/MSVC)")
set(GN_EXTRA_ARGS "" CACHE STRING "Extra 'gn gen' arguments to pass when configuring WebRTC") set(GN_EXTRA_ARGS "" CACHE STRING "Extra 'gn gen' arguments to pass when configuring WebRTC")
set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass when compiling WebRTC") set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass when compiling WebRTC")
option(BUILD_DEB_PACKAGE "Build .deb package" OFF) option(BUILD_DEB_PACKAGE "Build .deb package" OFF)

View file

@ -1,10 +1,12 @@
function(add_webrtc_target SOURCE_DIR BUILD_DIR) function(add_webrtc_target SOURCE_DIR BUILD_DIR)
set(GEN_ARGS_COMMON "target_cpu=\"${TARGET_CPU}\" target_os=\"${TARGET_OS}\" is_component_build=false use_gold=false use_custom_libcxx=false use_custom_libcxx_for_host=false rtc_enable_protobuf=false") set(GEN_ARGS_COMMON "target_cpu=\"${TARGET_CPU}\" target_os=\"${TARGET_OS}\" is_component_build=false use_gold=false use_custom_libcxx=false use_custom_libcxx_for_host=false treat_warnings_as_errors=false rtc_enable_protobuf=false")
if (MSVC) if (USE_CLANG)
set(GEN_ARGS_COMMON "${GEN_ARGS_COMMON} is_clang=true use_lld=true")
else()
set(GEN_ARGS_COMMON "${GEN_ARGS_COMMON} is_clang=false use_lld=false") set(GEN_ARGS_COMMON "${GEN_ARGS_COMMON} is_clang=false use_lld=false")
endif () endif()
set(GEN_ARGS_DEBUG "${GEN_ARGS_COMMON} is_debug=true") set(GEN_ARGS_DEBUG "${GEN_ARGS_COMMON} is_debug=true")
set(GEN_ARGS_RELEASE "${GEN_ARGS_COMMON} is_debug=false") set(GEN_ARGS_RELEASE "${GEN_ARGS_COMMON} is_debug=false")