]> git.vomp.tv Git - vompclient.git/commitdiff
Add FORCE_COLOR and ALL_WARNINGS to compile-config
authorChris Tallon <chris@vomp.tv>
Wed, 22 Feb 2023 16:09:36 +0000 (16:09 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 22 Feb 2023 16:09:36 +0000 (16:09 +0000)
build.sh
compile-config.sample
src/CMakeLists.txt

index 340edcdf4bc843c85337dcb31ebc0e5c664a1fd6..42fb9047c61483b9cf2e24d7675e347a47907fda 100755 (executable)
--- 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
index ee9000a4ebd8285280a7e8491f5846744973e14d..12c67fddec88b4714caa99736206ad01ae3a7f8f 100644 (file)
@@ -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
index d34a97aef85a04b40b51e0c583a653e26dbe19a5..b1f0dda3d477de6a958f9faf1e5c40eabf87a3d3 100644 (file)
@@ -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)