Skip to content

Commit

Permalink
fixed #13132 - removed deprecated support for qmake (#6891)
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave authored Oct 28, 2024
1 parent 0794699 commit 554a69a
Show file tree
Hide file tree
Showing 31 changed files with 21 additions and 954 deletions.
88 changes: 0 additions & 88 deletions .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,94 +247,6 @@ jobs:
run: |
ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
build_qmake:

strategy:
matrix:
# no longer build with qmake on MacOS as brew might lack pre-built Qt5 packages causing the step to run for hours
os: [ubuntu-20.04, ubuntu-22.04]
fail-fast: false # Prefer quick result

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Install missing software on ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
# coreutils contains "nproc"
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils qt@5
# expose qmake
brew link qt@5 --force
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}

- name: Build GUI
run: |
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
pushd gui
qmake CONFIG+=debug CONFIG+=ccache HAVE_QCHART=yes
make -j$(nproc)
# TODO: binaries are in a different location on macos
- name: Build and Run GUI tests
if: contains(matrix.os, 'ubuntu')
run: |
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
pushd gui/test/cppchecklibrarydata
qmake CONFIG+=debug CONFIG+=ccache
make -j$(nproc)
./test-cppchecklibrarydata
popd
pushd gui/test/filelist
qmake CONFIG+=debug CONFIG+=ccache
make -j$(nproc)
./test-filelist
popd
pushd gui/test/projectfile
qmake CONFIG+=debug CONFIG+=ccache
make -j$(nproc)
./test-projectfile
popd
pushd gui/test/resultstree
qmake CONFIG+=debug CONFIG+=ccache
make -j$(nproc)
export QT_QPA_PLATFORM=offscreen
./test-resultstree
popd
pushd gui/test/translationhandler
qmake CONFIG+=debug CONFIG+=ccache
make -j$(nproc)
# TODO: requires X session because of QApplication dependency in translationhandler.cpp
#./test-translationhandler
popd
pushd gui/test/xmlreportv2
qmake CONFIG+=debug CONFIG+=ccache
make -j$(nproc)
./test-xmlreportv2
- name: Generate Qt help file
run: |
pushd gui/help
qhelpgenerator online-help.qhcp -o online-help.qhc
- name: Build triage
run: |
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
pushd tools/triage
qmake CONFIG+=debug CONFIG+=ccache
make -j$(nproc)
build:

strategy:
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/CI-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,15 @@ jobs:
modules: 'qtcharts'
cache: true

- name: Build GUI release (qmake)
- name: Build GUI release (Qt 5)
if: startsWith(matrix.qt_ver, '5')
run: |
cd gui || exit /b !errorlevel!
qmake HAVE_QCHART=yes || exit /b !errorlevel!
nmake release || exit /b !errorlevel!
env:
CL: /MP

- name: Deploy GUI
if: startsWith(matrix.qt_ver, '5')
run: |
windeployqt Build\gui || exit /b !errorlevel!
del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel!
del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel!
; TODO: enable rules?
; specify Release build so matchcompiler is used
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On || exit /b !errorlevel!
cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
- name: Build GUI release (CMake)
- name: Build GUI release (Qt 6)
if: startsWith(matrix.qt_ver, '6')
run: |
; TODO: enable rules?
Expand All @@ -72,7 +64,6 @@ jobs:
cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
- name: Deploy GUI
if: startsWith(matrix.qt_ver, '6')
run: |
windeployqt build\bin\Release || exit /b !errorlevel!
del build\bin\Release\cppcheck-gui.ilk || exit /b !errorlevel!
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ jobs:
run: |
zypper install -y cmake clang pcre-devel
zypper install -y include-what-you-use-tools
# fixes error during Qt installation
# /__w/cppcheck/Qt/6.7.0/gcc_64/bin/qmake: error while loading shared libraries: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
zypper install -y libgthread-2_0-0
ln -s iwyu_tool.py /usr/bin/iwyu_tool
# Fails on OpenSUSE:
Expand Down
32 changes: 0 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,42 +50,13 @@ ipch/
*.pbxuser
build/

# GUI build folders
/gui/debug/
/gui/release/
/gui/temp/
/triage/temp

# Other (generated) GUI files
/gui/*.qm
/gui/cppcheck-gui
/gui/cppcheck-gui.exe
/gui/gui.sln
/gui/gui.vcproj
/gui/help/online-help.qch
/gui/help/online-help.qhc
/gui/Makefile
/gui/Makefile.debug
/gui/Makefile.release
/gui/qrc_gui.cpp
/gui/test/Makefile
/gui/test/*/Makefile
/gui/test/*/*/Makefile
/gui/test/benchmark/simple/benchmark-simple
/gui/test/cppchecklibrarydata/qrc_resources.cpp
/gui/test/cppchecklibrarydata/test-cppchecklibrarydata
/gui/test/filelist/test-filelist
/gui/test/projectfile/test-projectfile
/gui/test/translationhandler/test-translationhandler
/gui/test/xmlreportv2/test-xmlreportv2

# Doxygen output folder
doxyoutput/

# qmake generated
htmlreport/.tox/
htmlreport/MANIFEST

# Backup files and stuff from patches
*.rej
*~
Expand Down Expand Up @@ -124,9 +95,6 @@ stage
.cache/
compile_commands.json

# qmake
.qmake.stash

#vs code
/.vscode

Expand Down
13 changes: 0 additions & 13 deletions build-pcre.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@ PCRE is a library that is used by the optional "rules" feature for the command
line version of cppcheck. It is readily available on Linux and Mac OS X, but
must be obtained separately for Windows.

If you're using qmake to generate makefiles, the following behavior applies:

- If you're not on Windows, it assumes by default that you have PCRE and want
to enable rules support. You can disable rules support (removing the PCRE
dependency) by passing HAVE_RULES=no to qmake.

- If you are on Windows, but have PCRE available, you can enable rules support
by passing HAVE_RULES=yes to qmake.

- Note: This includes using build.bat since it calls qmake - to use PCRE and
build.bat, you need to run set HAVE_RULES=yes before each run of build.bat


Build instructions
------------------

Expand Down
23 changes: 0 additions & 23 deletions console_common.pri

This file was deleted.

11 changes: 0 additions & 11 deletions externals/externals.pri

This file was deleted.

Loading

3 comments on commit 554a69a

@danmar
Copy link
Owner

@danmar danmar commented on 554a69a Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@firewave how do I build the triage tool? I don't see an instruction?

daniel@laptop:~/cppchecksolutions/cppcheck/tools/triage/build$ cmake ..
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.22)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/daniel/cppchecksolutions/cppcheck/tools/triage/build
daniel@laptop:~/cppchecksolutions/cppcheck/tools/triage/build$ make -j12
daniel@laptop:~/cppchecksolutions/cppcheck/tools/triage/build$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  Makefile

@pfultz2
Copy link
Contributor

@pfultz2 pfultz2 commented on 554a69a Nov 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to use the cmake at the top-level. I dont think the one in tools/triage can be used directly. Also BUILD_GUI and BUILD_TESTS need to be set as well.

mkdir build
cd build
cmake -DBUILD_GUI=On -DBUILD_TESTS=On ..
make triage

@firewave
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfultz2 Exactly.

The BUILD_TESTS requirement looks weird though. That should probably de-coupled from that and get its own option.

Please sign in to comment.