Skip to content

Commit 90a2c44

Browse files
committed
Fix broken build of the project when BUILD_SHARED_LIBS=1
1 parent cae24a9 commit 90a2c44

File tree

12 files changed

+876
-846
lines changed

12 files changed

+876
-846
lines changed

cmake/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ if (BUILD_SHARED_LIBS)
6464
add_definitions(-DBUILD_SHARED_LIBS)
6565
if (MSVC)
6666
message(WARNING "Building DLLs against the static VC run-time. This is not recommended if the DLLs are to be redistributed.")
67+
# There will be couple hundreds of these so suppress them away.
68+
add_definitions(-wd4251)
6769
endif()
6870
endif()
6971

src/ifcexpressparser/templates.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,24 @@
9393
9494
#define IfcSchema %(schema_name)s
9595
96+
#include "../ifcparse/IfcParse_Export.h"
9697
#include "../ifcparse/IfcUtil.h"
9798
#include "../ifcparse/IfcEntityDescriptor.h"
9899
#include "../ifcparse/IfcWritableEntity.h"
99100
100101
namespace %(schema_name)s {
101102
namespace Type {
102-
int GetAttributeCount(Enum t);
103-
int GetAttributeIndex(Enum t, const std::string& a);
104-
IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
105-
Enum GetAttributeEntity(Enum t, unsigned char a);
106-
const std::string& GetAttributeName(Enum t, unsigned char a);
107-
bool GetAttributeOptional(Enum t, unsigned char a);
108-
bool GetAttributeDerived(Enum t, unsigned char a);
109-
std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
110-
std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
111-
std::set<std::string> GetInverseAttributeNames(Enum t);
112-
void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
103+
IfcParse_EXPORT int GetAttributeCount(Enum t);
104+
IfcParse_EXPORT int GetAttributeIndex(Enum t, const std::string& a);
105+
IfcParse_EXPORT IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
106+
IfcParse_EXPORT Enum GetAttributeEntity(Enum t, unsigned char a);
107+
IfcParse_EXPORT const std::string& GetAttributeName(Enum t, unsigned char a);
108+
IfcParse_EXPORT bool GetAttributeOptional(Enum t, unsigned char a);
109+
IfcParse_EXPORT bool GetAttributeDerived(Enum t, unsigned char a);
110+
IfcParse_EXPORT std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
111+
IfcParse_EXPORT std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
112+
IfcParse_EXPORT std::set<std::string> GetInverseAttributeNames(Enum t);
113+
IfcParse_EXPORT void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
113114
}}
114115
115116
#endif
@@ -389,8 +390,8 @@ class IfcParse_EXPORT %(name)s : public %(superclass)s {
389390
enumeration = """namespace %(name)s {
390391
%(documentation)s
391392
typedef enum {%(values)s} %(name)s;
392-
const char* ToString(%(name)s v);
393-
%(name)s FromString(const std::string& s);
393+
IfcParse_EXPORT const char* ToString(%(name)s v);
394+
IfcParse_EXPORT %(name)s FromString(const std::string& s);
394395
}
395396
"""
396397

src/ifcparse/Ifc2x3-latebound.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,24 @@
2929

3030
#define IfcSchema Ifc2x3
3131

32+
#include "../ifcparse/IfcParse_Export.h"
3233
#include "../ifcparse/IfcUtil.h"
3334
#include "../ifcparse/IfcEntityDescriptor.h"
3435
#include "../ifcparse/IfcWritableEntity.h"
3536

3637
namespace Ifc2x3 {
3738
namespace Type {
38-
int GetAttributeCount(Enum t);
39-
int GetAttributeIndex(Enum t, const std::string& a);
40-
IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
41-
Enum GetAttributeEntity(Enum t, unsigned char a);
42-
const std::string& GetAttributeName(Enum t, unsigned char a);
43-
bool GetAttributeOptional(Enum t, unsigned char a);
44-
bool GetAttributeDerived(Enum t, unsigned char a);
45-
std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
46-
std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
47-
std::set<std::string> GetInverseAttributeNames(Enum t);
48-
void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
39+
IfcParse_EXPORT int GetAttributeCount(Enum t);
40+
IfcParse_EXPORT int GetAttributeIndex(Enum t, const std::string& a);
41+
IfcParse_EXPORT IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
42+
IfcParse_EXPORT Enum GetAttributeEntity(Enum t, unsigned char a);
43+
IfcParse_EXPORT const std::string& GetAttributeName(Enum t, unsigned char a);
44+
IfcParse_EXPORT bool GetAttributeOptional(Enum t, unsigned char a);
45+
IfcParse_EXPORT bool GetAttributeDerived(Enum t, unsigned char a);
46+
IfcParse_EXPORT std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
47+
IfcParse_EXPORT std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
48+
IfcParse_EXPORT std::set<std::string> GetInverseAttributeNames(Enum t);
49+
IfcParse_EXPORT void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
4950
}}
5051

5152
#endif

src/ifcparse/Ifc2x3.h

Lines changed: 328 additions & 328 deletions
Large diffs are not rendered by default.

src/ifcparse/Ifc4-latebound.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ void InitDescriptorMap() {
272272
current->add("wrappedValue",false,IfcUtil::Argument_DOUBLE);
273273
current = entity_descriptor_map[Type::IfcSpecularRoughness] = new IfcEntityDescriptor(Type::IfcSpecularRoughness,0);
274274
current->add("wrappedValue",false,IfcUtil::Argument_DOUBLE);
275+
current = entity_descriptor_map[Type::IfcStrippedOptional] = new IfcEntityDescriptor(Type::IfcStrippedOptional,0);
276+
current->add("wrappedValue",false,IfcUtil::Argument_BOOL);
275277
current = entity_descriptor_map[Type::IfcTemperatureGradientMeasure] = new IfcEntityDescriptor(Type::IfcTemperatureGradientMeasure,0);
276278
current->add("wrappedValue",false,IfcUtil::Argument_DOUBLE);
277279
current = entity_descriptor_map[Type::IfcTemperatureRateOfChangeMeasure] = new IfcEntityDescriptor(Type::IfcTemperatureRateOfChangeMeasure,0);
@@ -474,7 +476,7 @@ void InitDescriptorMap() {
474476
current->add("Name",true,IfcUtil::Argument_STRING,Type::IfcLabel);
475477
current->add("Description",true,IfcUtil::Argument_STRING,Type::IfcText);
476478
current->add("Category",true,IfcUtil::Argument_STRING,Type::IfcLabel);
477-
current->add("Priority",true,IfcUtil::Argument_DOUBLE,Type::IfcNormalisedRatioMeasure);
479+
current->add("Priority",true,IfcUtil::Argument_INT,Type::IfcInteger);
478480
current = entity_descriptor_map[Type::IfcMaterialLayerSet] = new IfcEntityDescriptor(Type::IfcMaterialLayerSet,entity_descriptor_map.find(Type::IfcMaterialDefinition)->second);
479481
current->add("MaterialLayers",false,IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE,Type::IfcMaterialLayer);
480482
current->add("LayerSetName",true,IfcUtil::Argument_STRING,Type::IfcLabel);
@@ -489,7 +491,7 @@ void InitDescriptorMap() {
489491
current->add("Description",true,IfcUtil::Argument_STRING,Type::IfcText);
490492
current->add("Material",true,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcMaterial);
491493
current->add("Profile",false,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcProfileDef);
492-
current->add("Priority",true,IfcUtil::Argument_DOUBLE,Type::IfcNormalisedRatioMeasure);
494+
current->add("Priority",true,IfcUtil::Argument_INT,Type::IfcInteger);
493495
current->add("Category",true,IfcUtil::Argument_STRING,Type::IfcLabel);
494496
current = entity_descriptor_map[Type::IfcMaterialProfileSet] = new IfcEntityDescriptor(Type::IfcMaterialProfileSet,entity_descriptor_map.find(Type::IfcMaterialDefinition)->second);
495497
current->add("Name",true,IfcUtil::Argument_STRING,Type::IfcLabel);
@@ -705,6 +707,7 @@ void InitDescriptorMap() {
705707
current->add("DispersionFactor",true,IfcUtil::Argument_DOUBLE,Type::IfcReal);
706708
current = entity_descriptor_map[Type::IfcSurfaceStyleShading] = new IfcEntityDescriptor(Type::IfcSurfaceStyleShading,entity_descriptor_map.find(Type::IfcPresentationItem)->second);
707709
current->add("SurfaceColour",false,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcColourRgb);
710+
current->add("Transparency",true,IfcUtil::Argument_DOUBLE,Type::IfcNormalisedRatioMeasure);
708711
current = entity_descriptor_map[Type::IfcSurfaceStyleWithTextures] = new IfcEntityDescriptor(Type::IfcSurfaceStyleWithTextures,entity_descriptor_map.find(Type::IfcPresentationItem)->second);
709712
current->add("Textures",false,IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE,Type::IfcSurfaceTexture);
710713
current = entity_descriptor_map[Type::IfcSurfaceTexture] = new IfcEntityDescriptor(Type::IfcSurfaceTexture,entity_descriptor_map.find(Type::IfcPresentationItem)->second);
@@ -973,7 +976,7 @@ void InitDescriptorMap() {
973976
current->add("URLReference",false,IfcUtil::Argument_STRING,Type::IfcURIReference);
974977
current = entity_descriptor_map[Type::IfcIndexedColourMap] = new IfcEntityDescriptor(Type::IfcIndexedColourMap,entity_descriptor_map.find(Type::IfcPresentationItem)->second);
975978
current->add("MappedTo",false,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcTessellatedFaceSet);
976-
current->add("Overrides",true,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcSurfaceStyleShading);
979+
current->add("Opacity",true,IfcUtil::Argument_DOUBLE,Type::IfcNormalisedRatioMeasure);
977980
current->add("Colours",false,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcColourRgbList);
978981
current->add("ColourIndex",false,IfcUtil::Argument_AGGREGATE_OF_INT,Type::IfcPositiveInteger);
979982
current = entity_descriptor_map[Type::IfcIndexedTextureMap] = new IfcEntityDescriptor(Type::IfcIndexedTextureMap,entity_descriptor_map.find(Type::IfcTextureCoordinate)->second);
@@ -1224,7 +1227,6 @@ void InitDescriptorMap() {
12241227
current = entity_descriptor_map[Type::IfcSurface] = new IfcEntityDescriptor(Type::IfcSurface,entity_descriptor_map.find(Type::IfcGeometricRepresentationItem)->second);
12251228

12261229
current = entity_descriptor_map[Type::IfcSurfaceStyleRendering] = new IfcEntityDescriptor(Type::IfcSurfaceStyleRendering,entity_descriptor_map.find(Type::IfcSurfaceStyleShading)->second);
1227-
current->add("Transparency",true,IfcUtil::Argument_DOUBLE,Type::IfcNormalisedRatioMeasure);
12281230
current->add("DiffuseColour",true,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcColourOrFactor);
12291231
current->add("TransmissionColour",true,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcColourOrFactor);
12301232
current->add("DiffuseTransmissionColour",true,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcColourOrFactor);

src/ifcparse/Ifc4-latebound.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,24 @@
2929

3030
#define IfcSchema Ifc4
3131

32+
#include "../ifcparse/IfcParse_Export.h"
3233
#include "../ifcparse/IfcUtil.h"
3334
#include "../ifcparse/IfcEntityDescriptor.h"
3435
#include "../ifcparse/IfcWritableEntity.h"
3536

3637
namespace Ifc4 {
3738
namespace Type {
38-
int GetAttributeCount(Enum t);
39-
int GetAttributeIndex(Enum t, const std::string& a);
40-
IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
41-
Enum GetAttributeEntity(Enum t, unsigned char a);
42-
const std::string& GetAttributeName(Enum t, unsigned char a);
43-
bool GetAttributeOptional(Enum t, unsigned char a);
44-
bool GetAttributeDerived(Enum t, unsigned char a);
45-
std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
46-
std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
47-
std::set<std::string> GetInverseAttributeNames(Enum t);
48-
void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
39+
IfcParse_EXPORT int GetAttributeCount(Enum t);
40+
IfcParse_EXPORT int GetAttributeIndex(Enum t, const std::string& a);
41+
IfcParse_EXPORT IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
42+
IfcParse_EXPORT Enum GetAttributeEntity(Enum t, unsigned char a);
43+
IfcParse_EXPORT const std::string& GetAttributeName(Enum t, unsigned char a);
44+
IfcParse_EXPORT bool GetAttributeOptional(Enum t, unsigned char a);
45+
IfcParse_EXPORT bool GetAttributeDerived(Enum t, unsigned char a);
46+
IfcParse_EXPORT std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
47+
IfcParse_EXPORT std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
48+
IfcParse_EXPORT std::set<std::string> GetInverseAttributeNames(Enum t);
49+
IfcParse_EXPORT void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
4950
}}
5051

5152
#endif

src/ifcparse/Ifc4.cpp

Lines changed: 31 additions & 19 deletions
Large diffs are not rendered by default.

src/ifcparse/Ifc4.h

Lines changed: 457 additions & 447 deletions
Large diffs are not rendered by default.

src/ifcparse/Ifc4enum.h

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/ifcparse/IfcLogger.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434

3535
#include <boost/optional.hpp>
3636

37+
#include "IfcParse_Export.h"
3738

38-
class Logger {
39+
class IfcParse_EXPORT Logger {
3940
public:
4041
typedef enum { LOG_NOTICE, LOG_WARNING, LOG_ERROR } Severity;
4142
private:
@@ -59,4 +60,4 @@ class Logger {
5960
static std::string GetLog();
6061
};
6162

62-
#endif
63+
#endif

0 commit comments

Comments
 (0)