updated precompiled headers based on `ClangBuildAnalyzer` (#4775)

This commit is contained in:
Oliver Stöneberg 2023-02-08 08:19:21 +01:00 committed by GitHub
parent 608be24726
commit 66758d65f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 55 additions and 9 deletions

View File

@ -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

View File

@ -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()

31
gui/precompiled.h Normal file
View File

@ -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>

View File

@ -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"

View File

@ -135,7 +135,10 @@ public:
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)

View File

@ -17,8 +17,14 @@
*/
#pragma once
#include "fixture.h"
#include "settings.h"
#include "tokenize.h"
#include "library.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"