From 109746fad7f7e39445ca57ec0ebdb27e120c33e1 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sun, 13 Nov 2022 11:02:41 +0100 Subject: [PATCH] Colours --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1d6bffe..ee1d4c2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,8 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.24) cmake_policy(SET CMP0135 NEW) endif() +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + include(FetchContent) include(ExternalProject) @@ -15,6 +17,16 @@ option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the V option(WIVRN_BUILD_CLIENT "Build WiVRn client" ON) option(WIVRN_BUILD_SERVER "Build WiVRn server" ON) +option(ENABLE_COLOURED_OUTPUT "Always produce ANSI-coloured output (GNU/Clang only)." ON) + +if(ENABLE_COLOURED_OUTPUT) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_compile_options(-fdiagnostics-color=always) + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_compile_options(-fcolor-diagnostics) + endif() +endif() + find_package(PkgConfig REQUIRED) find_package(Vulkan REQUIRED)