0028417: Using PRECOMPILED HEADER to speed up compilation time
authorabv <abv@opencascade.com>
Thu, 29 Jun 2017 17:17:39 +0000 (20:17 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 6 Jul 2017 09:41:41 +0000 (12:41 +0300)
commit896faa7296b6d79ce265eb5d9f5ddbad181a5596
treee208fae2de488e422b25f7e219cc730352e10560
parenta07cff69572d2c30d9bc657ac72e66c79c4b13e3
0028417: Using PRECOMPILED HEADER to speed up compilation time

Use of Cotire tool is introduced for acceleration of CMake builds, by usage of precompiled headers.
CMake option BUILD_USE_PCH is added to enable / disable use of precompiled headers

When precompiled headers are used, additional compiler macros are defined globally in the build system to avoid problems due to different order of included files:
- NOMINMAX is defined on Windows to prevent defining "min" and "max" as macros by windows.h
- STRSAFE_NO_DEPRECATE and _SCL_SECURE_NO_WARNINGS are defined on Windows to prevent declaring functions of standard C library as deprecated by #pragma, and other warnings in system headers
- GL_GLEXT_LEGACY and GLX_GLEXT_LEGACY are defined to ensure that only OCCT's own glext.h is used
- __STDC_FORMAT_MACROS is defined to have standard C print format macros always defined

Code is corrected to avoid conflicts with system headers and in case of compiling together as unity builds (partially):
- Some locally defined variables in TKV3d, TKHLR are renamed to be unique
- Duplicated definitions of macros and global functions are eliminated in TKSTEP
- Useless header WNT_UInt.hxx is removed
- Usage of local variables conflicting with X11 macro is avoided in Draw_Viewer.cxx
- Local variables in AIS_ConcentricRelation.cxx are renamed to avoid conflict with macros defined in windows.h
- HXX files containing code are renamed to PXX or merged with corresponding CXX files.

IVtkTools classes are corrected to avoid compiler warnings disabled in non-PCH builds by inclusion of VTK headers.

Useless pragmas disabling warnings on MSVC are removed
91 files changed:
CMakeLists.txt
adm/cmake/cotire.cmake [new file with mode: 0644]
adm/cmake/occt_toolkit.cmake
adm/cmake/vardescr.cmake
dox/dev_guides/upgrade/upgrade.md
dox/overview/overview.md
src/AIS/AIS_ConcentricRelation.cxx
src/AIS/AIS_InteractiveContext_1.cxx
src/AIS/AIS_LocalContext_1.cxx
src/BOPDS/BOPDS_PassKey.cxx
src/BOPDS/BOPDS_PaveBlock.cxx
src/DDF/DDF_IOStream.hxx
src/DPrsStd/DPrsStd.cxx
src/Draw/Draw_Viewer.cxx
src/Geom/Geom_Ellipse.cxx
src/Graphic3d/Graphic3d_Texture1D.cxx
src/Graphic3d/Graphic3d_Texture2D.cxx
src/Graphic3d/Graphic3d_TextureEnv.cxx
src/HLRAlgo/HLRAlgo_PolyData.cxx
src/HLRAlgo/HLRAlgo_PolyInternalData.cxx
src/HLRBRep/HLRBRep_InternalAlgo.cxx
src/IGESSelect/IGESSelect_IGESTypeForm.hxx
src/IVtkDraw/IVtkDraw.cxx
src/IVtkDraw/IVtkDraw_Interactor.cxx
src/IVtkTools/IVtkTools_DisplayModeFilter.hxx
src/IVtkTools/IVtkTools_ShapeDataSource.hxx
src/IVtkTools/IVtkTools_ShapeObject.hxx
src/IVtkTools/IVtkTools_ShapePicker.hxx
src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx
src/IVtkTools/IVtkTools_SubPolyDataFilter.hxx
src/IntTools/IntTools.cxx
src/IntTools/IntTools_EdgeFace.cxx
src/Message/Message_ProgressScale.cxx
src/OSD/OSD_Chronometer.cxx
src/OSD/OSD_DirectoryIterator.cxx
src/OSD/OSD_Disk.cxx
src/OSD/OSD_Environment.cxx
src/OSD/OSD_Error.cxx
src/OSD/OSD_FileIterator.cxx
src/OSD/OSD_FileNode.cxx
src/OSD/OSD_Host.cxx
src/OSD/OSD_Timer.cxx
src/OSD/OSD_signal.cxx
src/OpenGl/OpenGl_Context_1.mm
src/OpenGl/OpenGl_Window_1.mm
src/PLib/FILES
src/PLib/PLib_JacobiPolynomial.cxx
src/PLib/PLib_JacobiPolynomial_Data.pxx [moved from src/PLib/PLib_JacobiPolynomial_0.hxx with 99% similarity]
src/Poly/Poly_CoherentNode.cxx
src/QANCollection/QANCollection_Stl.cxx
src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/SelectMgr/SelectMgr_SelectableObjectSet.cxx
src/SelectMgr/SelectMgr_ViewerSelector.cxx
src/Standard/Standard_OutOfMemory.cxx
src/StdDrivers/StdDrivers.cxx
src/StdLDrivers/StdLDrivers.cxx
src/StepDimTol/StepDimTol_ToleranceZone.hxx
src/TNaming/TNaming_NCollections.hxx
src/TNaming/TNaming_Naming.cxx
src/TObjDRAW/TObjDRAW.cxx
src/TopOpeBRep/TopOpeBRep_FacesFiller.cxx
src/TopOpeBRepBuild/FILES
src/TopOpeBRepBuild/TopOpeBRepBuild_Builder.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_Fill.pxx [deleted file]
src/TopOpeBRepBuild/TopOpeBRepBuild_ShapeListOfShape.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_SplitEdge.hxx [deleted file]
src/TopOpeBRepBuild/TopOpeBRepBuild_SplitFace.hxx [deleted file]
src/TopOpeBRepBuild/TopOpeBRepBuild_SplitShapes.hxx [deleted file]
src/TopOpeBRepBuild/TopOpeBRepBuild_SplitSolid.pxx [deleted file]
src/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx
src/TopOpeBRepTool/FILES
src/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx
src/TopOpeBRepTool/TopOpeBRepTool_PURGE.hxx
src/TopOpeBRepTool/TopOpeBRepTool_SC.hxx
src/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx
src/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.hxx
src/TopOpeBRepTool/TopOpeBRepTool_closing.cxx [deleted file]
src/TopOpeBRepTool/TopOpeBRepTool_define.hxx
src/TopOpeBRepTool/TopOpeBRepTool_faulty.cxx
src/TopTrans/TopTrans_SurfaceTransition.cxx
src/VrmlData/VrmlData_Geometry.cxx
src/VrmlData/VrmlData_ShapeConvert.cxx
src/WNT/FILES
src/WNT/WNT_Uint.hxx [deleted file]
src/WNT/WNT_WClass.cxx
src/WNT/WNT_WClass.hxx
src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx
src/gp/gp_GTrsf.hxx
src/gp/gp_Trsf.hxx