Move IFCOPENSHELL_VERSION definition from IfcParse.h

To prevent recompiling all files that have IfcParse.h include and improve caching.
This commit is contained in:
Andrej730
2025-09-30 18:11:33 +05:00
parent f6ebf80fab
commit babf95785c
8 changed files with 49 additions and 15 deletions
+2 -2
View File
@@ -2706,8 +2706,8 @@ void IfcFile::setDefaultHeaderValues() {
header().file_name()->settime_stamp(createTimestamp());
header().file_name()->setauthor(string_vector);
header().file_name()->setorganization(string_vector);
header().file_name()->setpreprocessor_version("IfcOpenShell " IFCOPENSHELL_VERSION);
header().file_name()->setoriginating_system("IfcOpenShell " IFCOPENSHELL_VERSION);
header().file_name()->setpreprocessor_version("IfcOpenShell " + std::string(IFCOPENSHELL_VERSION));
header().file_name()->setoriginating_system("IfcOpenShell " + std::string(IFCOPENSHELL_VERSION));
header().file_name()->setauthorization(empty_string);
header().file_schema()->setschema_identifiers(schema_identifiers);
+2 -5
View File
@@ -43,11 +43,8 @@
#include <string>
#include <vector>
#if defined(IFCOPENSHELL_BRANCH) && defined(IFCOPENSHELL_COMMIT)
#define IFCOPENSHELL_VERSION STRINGIFY(IFCOPENSHELL_BRANCH) "-" STRINGIFY(IFCOPENSHELL_COMMIT)
#else
#define IFCOPENSHELL_VERSION "0.8.0"
#endif
extern const char *IFCOPENSHELL_VERSION;
namespace IfcParse {
+35
View File
@@ -0,0 +1,35 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell 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 *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
/********************************************************************************
* *
* This file provides functions for loading an IFC file into memory and access *
* its entities either by ID, by an IfcSchema::Type or by reference *
* *
********************************************************************************/
#include <string>
#include "macros.h"
#if defined(IFCOPENSHELL_BRANCH) && defined(IFCOPENSHELL_COMMIT)
const char *IFCOPENSHELL_VERSION = STRINGIFY(IFCOPENSHELL_BRANCH) "-" STRINGIFY(IFCOPENSHELL_COMMIT);
#else
const char *IFCOPENSHELL_VERSION = "0.8.0";
#endif