Merge pull request #24107 from mrpilot2/cmake_pch_mods

Mods (Part 1): use CMake to generate precompiled headers on all platforms
This commit is contained in:
Chris Hennes
2025-09-23 08:35:43 -05:00
committed by GitHub
753 changed files with 511 additions and 2327 deletions

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <SMESH_Version.h>

View File

@@ -20,11 +20,9 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cstdlib>
#include <memory>
#endif
#include <App/Application.h>
#include <App/Document.h>

View File

@@ -90,7 +90,6 @@ SET(Mod_SRCS
AppFemPy.cpp
FemTools.cpp
FemTools.h
PreCompiled.cpp
PreCompiled.h
)
SOURCE_GROUP("Module" FILES ${Mod_SRCS})
@@ -182,14 +181,14 @@ SET(Fem_SRCS
${Python_SRCS}
)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" Fem_CPP_SRCS ${Fem_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(Fem PreCompiled.h PreCompiled.cpp Fem_CPP_SRCS)
endif(FREECAD_USE_PCH)
add_library(Fem SHARED ${Fem_SRCS})
if(FREECAD_USE_PCH)
target_precompile_headers(Fem PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:"${CMAKE_CURRENT_LIST_DIR}/PreCompiled.h">
)
endif(FREECAD_USE_PCH)
target_include_directories(
Fem
PRIVATE

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <App/DocumentObjectPy.h>
#include <App/FeaturePythonPyImp.h>

View File

@@ -21,10 +21,8 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <limits>
#include <Adaptor3d_IsoCurve.hxx>
#include <BRepAdaptor_CompCurve.hxx>
#include <BRepAdaptor_Curve.hxx>
@@ -55,7 +53,6 @@
#include <Adaptor3d_HSurface.hxx>
#include <BRepAdaptor_HSurface.hxx>
#endif
#endif
#include <App/Document.h>
#include <App/DocumentObjectPy.h>

View File

@@ -21,13 +21,11 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <TopoDS.hxx>
#endif
#include <Mod/Part/App/PartFeature.h>

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintContact.h"

View File

@@ -23,7 +23,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintDisplacement.h"

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintFixed.h"

View File

@@ -21,11 +21,9 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Precision.hxx>
#endif
#include <Base/Console.h>

View File

@@ -21,11 +21,9 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Precision.hxx>
#endif
#include "FemConstraintForce.h"

View File

@@ -21,11 +21,9 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Precision.hxx>
#endif
#include "FemConstraintGear.h"

View File

@@ -22,7 +22,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintHeatflux.h"

View File

@@ -23,7 +23,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintInitialTemperature.h"

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintPlaneRotation.h"

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintPressure.h"

View File

@@ -21,11 +21,9 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Precision.hxx>
#endif
#include "FemConstraintPulley.h"

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintRigidBody.h"

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintSpring.h"

View File

@@ -23,7 +23,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemConstraintTemperature.h"

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <Base/Tools.h>
#include <Mod/Part/App/PartFeature.h>

View File

@@ -20,9 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#include <cstdlib>
#include <memory>
@@ -58,7 +55,6 @@
#include <boost/assign/list_of.hpp>
#include <boost/tokenizer.hpp> //to simplify parsing input files we use the boost lib
#endif
#include <App/Application.h>
#include <Base/Console.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <App/FeaturePythonPyImp.h>
#include <App/GeoFeaturePy.h>

View File

@@ -20,11 +20,9 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <sstream>
#endif
#include <Base/PlacementPy.h>
#include <Base/Reader.h>

View File

@@ -20,9 +20,7 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#include <SMDSAbs_ElementType.hxx>
#include <SMDS_MeshElement.hxx>
@@ -35,7 +33,7 @@
#include <TopoDS_Shape.hxx>
#include <algorithm>
#include <stdexcept>
#endif
#include "Mod/Fem/App/FemMesh.h"
#include <Base/PlacementPy.h>

View File

@@ -20,10 +20,8 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <SMESH_Version.h>
#ifndef _PreComp_
#include <Python.h>
#include <SMESHDS_Mesh.hxx>
#include <SMESH_Mesh.hxx>
@@ -32,7 +30,6 @@
#include <NETGENPlugin_Hypothesis.hxx>
#include <NETGENPlugin_Mesher.hxx>
#endif
#endif
#include <App/DocumentObjectPy.h>
#include <Base/Console.h>

View File

@@ -20,11 +20,9 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <SMESH_Mesh.hxx>
#endif
#include <App/FeaturePythonPyImp.h>
#include <App/GeoFeaturePy.h>

View File

@@ -20,11 +20,7 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#endif
#include "FemPostBranchFilter.h"
#include "FemPostBranchFilterPy.h"

View File

@@ -20,10 +20,7 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#endif
// clang-format off
#include "FemPostBranchFilter.h"

View File

@@ -20,9 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#include <vtkDoubleArray.h>
#include <vtkPointData.h>
@@ -30,7 +27,6 @@
#include <vtkAlgorithmOutput.h>
#include <vtkUnstructuredGrid.h>
#include <vtkInformation.h>
#endif
#include <App/FeaturePythonPyImp.h>
#include <App/Document.h>

View File

@@ -20,10 +20,7 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#endif
#include <Base/FileInfo.h>
#include <Base/UnitPy.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemPostFunction.h"
#include <App/Document.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemPostGroupExtension.h"
#include <App/Document.h>

View File

@@ -20,14 +20,10 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <vtkDataSet.h>
#include <vtkXMLDataSetWriter.h>
#include <vtkXMLMultiBlockDataWriter.h>
#include <vtkTransform.h>
#endif
#include <Base/Exception.h>

View File

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

View File

@@ -20,10 +20,8 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <Python.h>
#include <vtkAppendFilter.h>
#include <vtkDataSetReader.h>
@@ -45,7 +43,6 @@
#include <vtkStringArray.h>
#include <vtkInformation.h>
#include <vtkInformationVector.h>
#endif
#include <Base/Console.h>

View File

@@ -20,10 +20,8 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#endif
#include <Base/FileInfo.h>
#include <Base/UnitPy.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <App/DocumentObjectPy.h>
#include <App/FeaturePythonPyImp.h>

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <App/DocumentObjectPy.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <App/DocumentObjectPy.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <App/DocumentObjectPy.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemSetGeometryObject.h"
#include <App/DocumentObjectPy.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <App/DocumentObjectPy.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "FemSetObject.h"
#include <App/DocumentObjectPy.h>

View File

@@ -21,7 +21,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include <App/DocumentObjectPy.h>
#include <App/FeaturePythonPyImp.h>

View File

@@ -20,9 +20,7 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <QStandardPaths>
#include <QStringList>
@@ -45,7 +43,6 @@
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#endif
#include <App/Application.h>
#include <Mod/Part/App/PartFeature.h>

View File

@@ -21,9 +21,7 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#include <charconv>
#include <cmath>
@@ -64,7 +62,6 @@
#include <vtkXMLPUnstructuredGridReader.h>
#include <vtkXMLUnstructuredGridReader.h>
#include <vtkXMLUnstructuredGridWriter.h>
#endif
#include <App/Application.h>
#include <App/Document.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#include "PreCompiled.h"
// HypothesisPy.h must be included as first file to avoid compiler warning,
// see: https://forum.freecad.org/viewtopic.php?p=633192#p633192
@@ -28,7 +27,6 @@
#include <SMESH_Version.h> // needed for SMESH_VERSION_MAJOR
#ifndef _PreComp_
#include <StdMeshers_Arithmetic1D.hxx>
#include <StdMeshers_AutomaticLength.hxx>
#include <StdMeshers_CompositeSegment_1D.hxx>
@@ -63,7 +61,6 @@
#include <StdMeshers_StartEndLength.hxx>
#include <StdMeshers_UseExisting_1D2D.hxx>
#include <sstream>
#endif
#include <Base/Interpreter.h>
#include <Mod/Part/App/TopoShapePy.h>

View File

@@ -1,24 +0,0 @@
/***************************************************************************
* Copyright (c) 2008 Jürgen Riegel <juergen.riegel@web.de> *
* *
* 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

@@ -25,8 +25,6 @@
#include <FCConfig.h>
#ifdef _PreComp_
// standard
#include <algorithm>
#include <bitset>
@@ -56,7 +54,6 @@
#include <SMDS_MeshElement.hxx>
#include <SMDS_MeshGroup.hxx>
#include <SMDS_MeshNode.hxx>
#include <SMDS_PolyhedralVolumeOfNodes.hxx>
#include <SMESHDS_Group.hxx>
#include <SMESHDS_GroupBase.hxx>
#include <SMESHDS_Mesh.hxx>
@@ -101,6 +98,8 @@
#include <StdMeshers_UseExisting_1D2D.hxx>
// Opencascade
#include <Standard_Version.hxx>
#include <Adaptor3d_IsoCurve.hxx>
#include <BRepAdaptor_CompCurve.hxx>
#include <BRepAdaptor_Curve.hxx>
@@ -133,7 +132,6 @@
#include <ShapeAnalysis_ShapeTolerance.hxx>
#include <ShapeAnalysis_Surface.hxx>
#include <Standard_Real.hxx>
#include <Standard_Version.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
@@ -208,5 +206,4 @@
#include <NETGENPlugin_SimpleHypothesis_3D.hxx>
#endif
#endif // _PreComp_
#endif

View File

@@ -20,9 +20,7 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <Python.h>
#include <vtkCompositeDataSet.h>
#include <vtkMultiBlockDataSet.h>
@@ -43,7 +41,7 @@
#include <vtkXMLRectilinearGridReader.h>
#include <vtkXMLStructuredGridReader.h>
#include <vtkXMLUnstructuredGridReader.h>
#endif
#ifdef FC_USE_VTK_PYTHON
#include <vtkPythonUtil.h>