Commit ca764f59 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1500 Speed up cppcheck, which now uses the json generated by CMake as a...

#1500 Speed up cppcheck, which now uses the json generated by CMake as a base.A -j option has been used in command line, and the costly -f option has been removed.
parent 6e1e4991
......@@ -2,7 +2,10 @@ cppcheck:
stage: analysis
- python Scripts/CI/CppCheck/
# Cmake must be called to generate the compile_commands.json file; no need to actually compile the code!
- mkdir -p build
- cd build && python ../cmake/Scripts/ --cache_file=../cmake/PreCache/linux.cmake --mode=debug --cmake_args="-G Ninja"
- cd .. && python Scripts/CI/CppCheck/
dependencies: []
name: "artifact_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-cppcheck-xml"
# This script is assumed to be called within continous integration, just after a call to CMake to generate a file
# named 'compile_commands.json'.
import os
import time
import subprocess
if __name__ == "__main__":
morefem_source_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "Sources")
project_root_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "..")
json_file = os.path.join(project_root_dir, "build", "compile_commands.json")
cmd = \
# "-j",
# "4",
......@@ -136,6 +136,8 @@ else()
set(MOREFEM_MAIN_LIBS MoReFEM_utilities MoReFEM_core MoReFEM_geometry MoReFEM_felt MoReFEM_param MoReFEM_op MoReFEM_param_instances MoReFEM_op_instances MoReFEM_formulation_solver MoReFEM_model)
# Option to color the outputs with ninja.
# Adapted from
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment