From 2d81d9b7f8e82cc067c2a8dbab904ce9b410e0e1 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Wed, 22 Feb 2023 16:09:36 +0000 Subject: [PATCH] Add FORCE_COLOR and ALL_WARNINGS to compile-config --- build.sh | 1 + compile-config.sample | 6 ++++++ src/CMakeLists.txt | 11 +++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 340edcd..42fb904 100755 --- a/build.sh +++ b/build.sh @@ -12,4 +12,5 @@ fi mkdir build cmake $CROSS_COMPILE_INSERT -DENABLE_MOLD=${ENABLE_MOLD} -DMOLD_BIN=${MOLD_BIN} \ + -DFORCE_COLOR=${FORCE_COLOR} -DALL_WARNINGS=${ALL_WARNINGS} \ -S src -B build && make -C build -j$MAKE_J diff --git a/compile-config.sample b/compile-config.sample index ee9000a..12c67fd 100644 --- a/compile-config.sample +++ b/compile-config.sample @@ -10,3 +10,9 @@ CROSS_COMPILER=gcc # Use mold for linker? (Only possible if compiler is clang) ENABLE_MOLD=no MOLD_BIN=/opt/mold/bin/mold + +# Force color output from compiler? remote distcc workers disable color by default +FORCE_COLOR=no + +# Add -Wold-style-cast and -Wconversion to compiler options +ALL_WARNINGS=no diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d34a97a..b1f0dda 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -94,13 +94,20 @@ target_compile_options(vomp PRIVATE -Wmissing-declarations -Winit-self -Woverloaded-virtual - -Wold-style-cast - -Wconversion -Wmissing-format-attribute -Wdisabled-optimization -Wmissing-noreturn ) +if (${ALL_WARNINGS}) + target_compile_options(vomp PRIVATE -Wold-style-cast -Wconversion) +endif() + +if (${FORCE_COLOR}) + target_compile_options(vomp PRIVATE -fdiagnostics-color=always) +endif() + + target_compile_options(vomp PRIVATE -D_GNU_SOURCE -DIPV4 -DIPV6 -DVOMP_PLATFORM_RASPBERRY -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DDEV) -- 2.39.2