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
1 change: 1 addition & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- name: Prepare CMake dependencies
run: |
# make sure the precompiled headers exist
make -C cmake.output/gui cmake_pch.hxx.pch
make -C cmake.output/lib cmake_pch.hxx.pch
make -C cmake.output/test cmake_pch.hxx.pch
# make sure the auto-generated GUI sources exist
Expand Down
3 changes: 3 additions & 0 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ CheckOptions:
else()
target_include_directories(cppcheck-gui SYSTEM PRIVATE ${tinyxml2_INCLUDE_DIRS})
endif()
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
target_precompile_headers(cppcheck-gui PRIVATE precompiled.h)
endif()
if (HAVE_RULES)
target_link_libraries(cppcheck-gui ${PCRE_LIBRARY})
endif()
Expand Down
31 changes: 31 additions & 0 deletions gui/precompiled.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2023 Cppcheck team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "checkthread.h"
#include "codeeditor.h"
#include "codeeditorstyle.h"
#include "config.h"
#include "cppcheck.h"
#include "cppchecklibrarydata.h"
#include "report.h"
#include "showtypes.h"

#include <QFile>
#include <QVariant>
12 changes: 7 additions & 5 deletions lib/precompiled.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
*/

#pragma once
#include "config.h"
#include "check.h"
#include "astutils.h"
#include "errorlogger.h"
#include "library.h"
//#include "matchcompiler.h"
#include "mathlib.h"
#include "token.h"
#include "tokenize.h"
#include "valueflow.h"
#include "symboldatabase.h"
#include "settings.h"
#include "suppressions.h"
#include "utils.h"
#include "valueflow.h"
3 changes: 3 additions & 0 deletions test/fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ class TestFixture : public ErrorLogger {
static std::size_t runTests(const options& args);
};

// TODO: fix these
// NOLINTNEXTLINE(readability-redundant-declaration)
extern std::ostringstream errout;
// NOLINTNEXTLINE(readability-redundant-declaration)
extern std::ostringstream output;

#define TEST_CASE( NAME ) do { if (prepareTest(#NAME)) { setVerbose(false); NAME(); } } while (false)
Expand Down
12 changes: 9 additions & 3 deletions test/precompiled.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
*/

#pragma once
#include "fixture.h"

#include "check.h"
#include "config.h"
#include "importproject.h"
#include "library.h"
#include "mathlib.h"
#include "settings.h"
#include "timer.h"
#include "token.h"
#include "tokenlist.h"
#include "tokenize.h"
#include "library.h"
#include "check.h"