Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,30 @@ jobs:
apt-get install -y cmake g++ make
apt-get install -y z3 libz3-dev
apt-get install -y libpcre3-dev
apt-get install -y libffi7 # work around missing dependency for Qt install step
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y clang-tidy-13

# uses "sudo" internally which is not available on docker by default
#- name: Install Qt
# uses: jurplel/install-qt-action@v2
# with:
# modules: 'qtcharts'
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
install-deps: 'nosudo'
version: '5.15.2'
modules: 'qtcharts'

- name: Prepare CMake
run: |
mkdir cmake.output
cd cmake.output
# cannot include GUI since we need to generate the ui_*.h files first
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=Off -DWITH_QCHART=Off ..
cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On ..
cd ..

- name: Clang-Tidy
run: |
# make sure the precompiled headers exist
make -C cmake.output lib/CMakeFiles/lib_objs.dir/cmake_pch.hxx.cxx
make -C cmake.output test/CMakeFiles/testrunner.dir/cmake_pch.hxx.cxx
make -C cmake.output autogen
cmake --build cmake.output --target run-clang-tidy 2> /dev/null
6 changes: 6 additions & 0 deletions cmake/clang_tidy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ message(STATUS "RUN_CLANG_TIDY=${RUN_CLANG_TIDY}")
if (RUN_CLANG_TIDY)
# disable all compiler warnings since we are just interested in the tidy ones
add_custom_target(run-clang-tidy ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -extra-arg=-w -quiet)
if (BUILD_GUI)
add_dependencies(run-clang-tidy gui-build-deps)
if (BUILD_TESTS)
add_dependencies(run-clang-tidy triage-build-ui-deps)
endif()
endif()
endif()
7 changes: 5 additions & 2 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ if (BUILD_GUI)
QT5_WRAP_UI(uis_hdrs ${uis})
QT5_ADD_RESOURCES(resources "gui.qrc")
QT5_ADD_TRANSLATION(qms ${tss})
list(APPEND cppcheck-gui_SOURCES ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:simplecpp_objs>)
list(APPEND cppcheck-gui-deps ${hdrs} ${uis_hdrs} ${resources} ${qms} )
add_custom_target(gui-build-deps SOURCES ${cppcheck-gui-deps})

list(APPEND cppcheck-gui_SOURCES ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:simplecpp_objs>)
if(USE_BUNDLED_TINYXML2)
list(APPEND cppcheck-gui_SOURCES $<TARGET_OBJECTS:tinyxml2_objs>)
endif()

add_executable(cppcheck-gui ${cppcheck-gui_SOURCES})
add_executable(cppcheck-gui ${cppcheck-gui-deps} ${cppcheck-gui_SOURCES})
set_target_properties(cppcheck-gui PROPERTIES AUTOMOC ON)
target_include_directories(cppcheck-gui PRIVATE ${PROJECT_SOURCE_DIR}/lib/)
if(USE_BUNDLED_TINYXML2)
Expand Down
1 change: 1 addition & 0 deletions tools/triage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (BUILD_GUI AND BUILD_TESTS)
file(GLOB uis "*.ui")
qt5_wrap_ui(uis_hdrs ${uis})

add_custom_target(triage-build-ui-deps SOURCES ${hdrs} ${uis_hdrs})
add_executable(
triage
${hdrs}
Expand Down