aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml14
-rw-r--r--CMakeLists.txt12
-rw-r--r--CMakeOptions.txt6
3 files changed, 29 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b279103db9..0f53faa95a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,6 +18,8 @@ variables:
GIT_DEPTH: "1"
GIT_FETCH_EXTRA_FLAGS: "--depth=5000"
CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
+ # Enable color output in CMake, Ninja, and other tools. https://bixense.com/clicolors/
+ CLICOLOR_FORCE: 1
.build:
stage: build
@@ -342,10 +344,14 @@ merge-req:ubuntu-gcc-ctest:
script:
# build-ubuntu puts us in `build`.
- CC=gcc CXX=g++ cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -G Ninja ..
- - ninja
+ - script --command ninja --flush --quiet --return ../gcc_report.txt
+ - ansi2html < ../gcc_report.txt > ../gcc_report.html
- ninja test-programs
- chown -R user .
- su user -c "ctest --parallel $(getconf _NPROCESSORS_ONLN) --force-new-ctest-process --verbose"
+ artifacts:
+ paths:
+ - gcc_report.html
merge-req:ubuntu-clang-other-tests:
extends: clang-11
@@ -363,14 +369,16 @@ merge-req:ubuntu-clang-other-tests:
- if [[ -s "cppcheck_report.xml" ]]; then cppcheck-htmlreport --file cppcheck_report.xml --report-dir . ; fi
- cd build
- cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -G Ninja ..
- - ninja
+ - script --command ninja --flush --quiet --return ../clang_report.txt
+ - ansi2html < ../clang_report.txt > ../clang_report.html
- ./run/tshark -v
- sh -c '[ ! -e ../tools/validate-clang-check.sh ] || ../tools/validate-clang-check.sh'
- ninja checkAPI
artifacts:
paths:
- - cppcheck_report.xml
+ - clang_report.html
- cppcheck_report.html
+ - cppcheck_report.xml
- item_calls_check.txt
- tfs_check.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a330d9bf68..bdd8130545 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -796,6 +796,18 @@ else() # ! MSVC
)
endif()
+ if(ENABLE_COMPILER_COLOR_DIAGNOSTICS)
+ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
+ set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
+ -fcolor-diagnostics
+ )
+ elseif(CMAKE_C_COMPILER_ID MATCHES "GNU")
+ set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
+ -fdiagnostics-color=always
+ )
+ endif()
+ endif()
+
add_definitions(
-DG_DISABLE_DEPRECATED
-DG_DISABLE_SINGLE_INCLUDES
diff --git a/CMakeOptions.txt b/CMakeOptions.txt
index a651c2ebb6..4c42664645 100644
--- a/CMakeOptions.txt
+++ b/CMakeOptions.txt
@@ -55,6 +55,12 @@ option(ENABLE_FUZZER "Enable libFuzzer instrumentation for use with fuzzshark" O
option(ENABLE_CHECKHF_CONFLICT "Enable hf conflict check for debugging (start-up may be slower)" OFF)
option(ENABLE_CCACHE "Speed up compiling and linking using ccache if possible" OFF)
+if(CMAKE_GENERATOR STREQUAL "Ninja")
+ option(ENABLE_COMPILER_COLOR_DIAGNOSTICS "Always enable the compiler's color diagnostic output" ON)
+else()
+ option(ENABLE_COMPILER_COLOR_DIAGNOSTICS "Always enable the compiler's color diagnostic output" OFF)
+endif()
+
if (WIN32)
option(ENABLE_LTO "Improves performance using Link time Optimization" ON)
else()