cleanup remaining implementations of precompiled headers

This commit is contained in:
Markus Reitböck
2025-08-23 13:40:22 +02:00
parent 715fc873fd
commit 65d4088c9e
23 changed files with 7 additions and 141 deletions

View File

@@ -211,47 +211,6 @@ macro(generate_from_any INPUT_FILE OUTPUT_FILE VARIABLE)
endmacro(generate_from_any)
MACRO(ADD_MSVC_PRECOMPILED_HEADER TargetName PrecompiledHeader PrecompiledSource SourcesVar)
IF(MSVC)
GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE)
IF(MSVC_IDE)
SET(PrecompiledBinary "$(IntDir)\\$(TargetName).pch")
ELSE(MSVC_IDE)
SET(PrecompiledBinary ${CMAKE_CURRENT_BINARY_DIR}/${TargetName}.pch)
ENDIF(MSVC_IDE)
SET(Sources ${${SourcesVar}})
SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource}
PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
OBJECT_OUTPUTS "${PrecompiledBinary}")
SET_SOURCE_FILES_PROPERTIES(${Sources}
PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledHeader}\" /FI\"${PrecompiledBinary}\" /Fp\"${PrecompiledBinary}\""
OBJECT_DEPENDS "${PrecompiledBinary}")
# Add precompiled header to SourcesVar
LIST(APPEND ${SourcesVar} ${PrecompiledSource})
ENDIF(MSVC)
ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER)
MACRO(GET_MSVC_PRECOMPILED_SOURCE PrecompiledSource SourcesVar)
IF(MSVC)
FOREACH (it ${ARGN})
GET_FILENAME_COMPONENT(file_ext ${it} EXT)
GET_FILENAME_COMPONENT(file_name ${it} NAME)
STRING(COMPARE EQUAL ${it} ${PrecompiledSource} pch)
IF (NOT pch)
# get c++ source files
STRING(REGEX MATCH "^(.cpp|.cc|.cxx)$" cpp_file ${file_ext})
# ignore any generated source files from Qt
STRING(REGEX MATCH "^(moc_|qrc_|ui_)" gen_file ${file_name})
IF(cpp_file AND NOT gen_file)
LIST(APPEND ${SourcesVar} ${it})
ENDIF(cpp_file AND NOT gen_file)
ENDIF(NOT pch)
ENDFOREACH (it)
ENDIF(MSVC)
ENDMACRO(GET_MSVC_PRECOMPILED_SOURCE)
# Macro to replace all the binary output locations. Takes 2 optional parameters.
# ${ARGVN} is zero based so the 3rd element is ${ARGV2}. When the 3rd element is missing,
# Runtime and Lib directories default to /bin and /lib. When present, the 3rd element

View File

@@ -38,6 +38,8 @@
#ifndef __PyCXX_wrap_python_hxx__
#define __PyCXX_wrap_python_hxx__
#include <FCConfig.h>
// On some platforms we have to include time.h to get select defined
#if !defined(__WIN32__) && !defined(WIN32) && !defined(_WIN32) && !defined(_WIN64)
#include <sys/time.h>

View File

@@ -23,10 +23,6 @@
#include "../FCConfig.h"
#ifdef _PreComp_
#undef _PreComp_
#endif
#if HAVE_CONFIG_H
#include <config.h>
#endif // HAVE_CONFIG_H

View File

@@ -28,10 +28,6 @@
#include <dbghelp.h>
#endif
#ifdef _PreComp_
#undef _PreComp_
#endif
#if HAVE_CONFIG_H
#include <config.h>
#endif // HAVE_CONFIG_H

View File

@@ -23,10 +23,6 @@
#include <FCConfig.h>
#ifdef _PreComp_
#undef _PreComp_
#endif
#if defined(FC_OS_WIN32)
#include <windows.h>
#endif

View File

@@ -18,7 +18,7 @@
* <https://www.gnu.org/licenses/>. *
* *
**************************************************************************/
#include "PreCompiled.h"
#include "Exceptions.h"
namespace Materials

View File

@@ -21,8 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "SketcherTransformationExpressionHelper.h"
#include <Gui/Command.h>

View File

@@ -21,10 +21,8 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#endif
#include <Base/Console.h>
#include <Base/Interpreter.h>

View File

@@ -4,7 +4,6 @@ set(_TEMPLATE__LIBS
SET(_TEMPLATE__SRCS
App_TEMPLATE_.cpp
PreCompiled.cpp
PreCompiled.h
)

View File

@@ -1,24 +0,0 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"

View File

@@ -33,8 +33,6 @@
#define _TEMPLATE_AppExport
#endif
#ifdef _PreComp_
// standard
#include <cassert>
#include <cstdio>
@@ -55,6 +53,4 @@
// Xerces
#include <xercesc/util/XercesDefs.hpp>
#endif //_PreComp_
#endif

View File

@@ -21,10 +21,8 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#endif
#include <Base/Console.h>
#include <Base/Interpreter.h>

View File

@@ -14,7 +14,6 @@ SET(_TEMPLATE_Gui_SRCS
${_TEMPLATE__QRC_SRCS}
App_TEMPLATE_Gui.cpp
Command.cpp
PreCompiled.cpp
PreCompiled.h
Workbench.cpp
Workbench.h

View File

@@ -20,11 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
#include <App/Document.h>
#include <Base/Console.h>
#include <Gui/Application.h>

View File

@@ -1,24 +0,0 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"

View File

@@ -35,8 +35,6 @@
#define _TEMPLATE_GuiExport
#endif
#ifdef _PreComp_
// standard
#include <cassert>
#include <cstdio>
@@ -63,6 +61,4 @@
// Qt Toolkit
#include <Gui/QtAll.h>
#endif //_PreComp_
#endif // GUI_PRECOMPILED_H

View File

@@ -20,12 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
#include "Workbench.h"
#include <Gui/MenuManager.h>
#include <Gui/ToolBarManager.h>

View File

@@ -37,5 +37,4 @@ Template = """
***************************************************************************/
#include "PreCompiled.h"
"""

View File

@@ -1235,7 +1235,6 @@ int @self.export.Name@::descriptorSetter(PyObject* self, PyObject* obj, PyObject
# Here's the template for the user part of the implementation. This does NOT get overridden if it already exists.
TemplateImplement = """
#include "PreCompiled.h"
#include "@self.export.Include@"

View File

@@ -56,7 +56,6 @@ public:
"""
TemplateModule = """
#include "PreCompiled.h"
#include "@self.feature.Name@.h"
@@ -74,7 +73,6 @@ PROPERTY_SOURCE(@self.module.Name@::@self.feature.Name@, App::Feature)
# Here's the template for the user part of the implementation. This does NOT get overwritten if it already exists.
TemplateImplement = """
//
#include "PreCompiled.h"
#include "@self.feature.Name@.h"

View File

@@ -23,10 +23,8 @@ class TemplateModuleAppMain(template.ModelTemplate):
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <Base/Console.h>

View File

@@ -1,4 +1,3 @@
#include "PreCompiled.h"
#include <QApplication>
#include <QMainWindow>

View File

@@ -565,14 +565,13 @@ def preference_dialog_define(param_set, header=True):
cog.out(
f"""
{trace_comment()}
#ifndef _PreComp_
# include <QApplication>
# include <QLabel>
# include <QGroupBox>
# include <QGridLayout>
# include <QVBoxLayout>
# include <QHBoxLayout>
#endif"""
"""
)
for _, params in param_group:
for param in params: