From 4fb3228c04f8623477947728abc02261475b280f Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 31 May 2020 16:50:59 +0200 Subject: [PATCH] cmake: Add an option to turn off clang integration This allows building the plugin with compilers that pretend to be clang but aren't actually clang, like Googles 'Depot Tools' and some Clang-like compiler tools. --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5552e492..43cd909b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,7 +79,8 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/clang" "${CMAKE_CURRENT # CMake Modules include("util") -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Clang/Clang.cmake") +## Clang Integration +if(${PropertyPrefix}ENABLE_CLANG AND (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Clang/Clang.cmake")) include("Clang") set(HAVE_CLANG ON) endif() @@ -246,8 +247,9 @@ set(${PropertyPrefix}ENABLE_SOURCE_MIRROR ${ENABLE_SOURCE_MIRROR} CACHE BOOL "En set(${PropertyPrefix}ENABLE_SOURCE_SHADER ${ENABLE_SOURCE_SHADER} CACHE BOOL "Enable Shader Source") ## Transitions set(${PropertyPrefix}ENABLE_TRANSITION_SHADER ${ENABLE_TRANSITION_SHADER} CACHE BOOL "Enable Shader Transition") -## Debugging +## Code Related set(${PropertyPrefix}ENABLE_PROFILING FALSE CACHE BOOL "Enable CPU and GPU performance tracking, which has a non-zero overhead at all times. Do not enable this for release builds.") +set(${PropertyPrefix}ENABLE_CLANG TRUE CACHE BOOL "Enable Clang integration for supported compilers.") ################################################################################ # CMake / Compiler Dependencies @@ -1008,7 +1010,7 @@ if(HAVE_OBS_FRONTEND) endif() # Clang Tools -if(HAVE_CLANG) +if(${PropertyPrefix}ENABLE_CLANG AND HAVE_CLANG) generate_compile_commands_json( TARGETS ${PROJECT_NAME} )