CMake: Add GCC/Clang -fdiagnostics=color compiler option.

This commit is contained in:
Joao Matos
2025-02-28 17:10:33 +00:00
committed by Yorik van Havre
parent d7e98b61cc
commit 855ad6c709

View File

@@ -48,6 +48,8 @@ macro(CompilerChecksAndSetups)
configure_file(${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_definitions(-DHAVE_CONFIG_H)
set(CMAKE_CXX_FLAGS "-fdiagnostics-color ${CMAKE_CXX_FLAGS}")
# For now only set pedantic option for clang
if(CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wno-write-strings ${CMAKE_CXX_FLAGS}")