From 16d45a03ca3f48bf1128b41c00e35263f0b3ef42 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} )