From 09996b852b9ab09ab1ce936d2abc0aea9d141ffe Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Fri, 23 Jan 2026 19:55:58 +0000 Subject: [PATCH] Foundation Classes - Extend precompiled headers (#1029) - Added precompiled header file for TKBool toolkit with commonly used headers - Extended TKDESTEP precompiled headers with Interface_EntityIterator.hxx - Configured Google Test to use precompiled headers when BUILD_USE_PCH is enabled --- adm/cmake/occt_gtest.cmake | 5 +++++ src/DataExchange/TKDESTEP/TKDESTEP_pch.hxx | 1 + src/ModelingAlgorithms/TKBool/CMakeLists.txt | 3 +++ src/ModelingAlgorithms/TKBool/FILES.cmake | 1 + src/ModelingAlgorithms/TKBool/TKBool_pch.hxx | 21 ++++++++++++++++++++ 5 files changed, 31 insertions(+) create mode 100644 src/ModelingAlgorithms/TKBool/TKBool_pch.hxx diff --git a/adm/cmake/occt_gtest.cmake b/adm/cmake/occt_gtest.cmake index be7c7c7333..4103384fe5 100644 --- a/adm/cmake/occt_gtest.cmake +++ b/adm/cmake/occt_gtest.cmake @@ -29,6 +29,11 @@ function(OCCT_INIT_GTEST) target_compile_definitions(${TEST_PROJECT_NAME} PRIVATE GTEST_LINKED_AS_SHARED_LIBRARY=1) + # Configure precompiled headers for Google Test + if (BUILD_USE_PCH) + target_precompile_headers(${TEST_PROJECT_NAME} PRIVATE ) + endif() + # Link with all active toolkits that are libraries foreach(TOOLKIT ${BUILD_TOOLKITS}) if(TARGET ${TOOLKIT}) diff --git a/src/DataExchange/TKDESTEP/TKDESTEP_pch.hxx b/src/DataExchange/TKDESTEP/TKDESTEP_pch.hxx index bc0b27f834..c574bc18fd 100644 --- a/src/DataExchange/TKDESTEP/TKDESTEP_pch.hxx +++ b/src/DataExchange/TKDESTEP/TKDESTEP_pch.hxx @@ -14,6 +14,7 @@ #ifndef TKDESTEP_PCH_H #define TKDESTEP_PCH_H +#include #include #include #include diff --git a/src/ModelingAlgorithms/TKBool/CMakeLists.txt b/src/ModelingAlgorithms/TKBool/CMakeLists.txt index 9bb388fdca..7401d7c7fa 100644 --- a/src/ModelingAlgorithms/TKBool/CMakeLists.txt +++ b/src/ModelingAlgorithms/TKBool/CMakeLists.txt @@ -1,3 +1,6 @@ project(TKBool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) + +# Add the precompiled header +ADD_PRECOMPILED_HEADER(TKBool "TKBool_pch.hxx" FALSE) diff --git a/src/ModelingAlgorithms/TKBool/FILES.cmake b/src/ModelingAlgorithms/TKBool/FILES.cmake index 93f37d0e3c..265b580234 100644 --- a/src/ModelingAlgorithms/TKBool/FILES.cmake +++ b/src/ModelingAlgorithms/TKBool/FILES.cmake @@ -2,4 +2,5 @@ set(OCCT_TKBool_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") set(OCCT_TKBool_FILES + TKBool_pch.hxx ) diff --git a/src/ModelingAlgorithms/TKBool/TKBool_pch.hxx b/src/ModelingAlgorithms/TKBool/TKBool_pch.hxx new file mode 100644 index 0000000000..e23a4c2b6d --- /dev/null +++ b/src/ModelingAlgorithms/TKBool/TKBool_pch.hxx @@ -0,0 +1,21 @@ +// Copyright (c) 2025 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef TKBOOL_PCH_H +#define TKBOOL_PCH_H + +#include +#include +#include + +#endif // TKBOOL_PCH_H