Skip to content

Commit 9b62ef6

Browse files
committed
Update source to not emit warnings with -Wexit-time-destructors -Wglobal-constructors compiler arguments enabled
1 parent 04e5071 commit 9b62ef6

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

source/JsMaterialX/JsMaterialXCore/JsProperty.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ EMSCRIPTEN_BINDINGS(property)
2424
.smart_ptr<std::shared_ptr<const mx::Property>>("Property")
2525
.class_property("CATEGORY", &mx::Property::CATEGORY);
2626

27+
std::string mx__PropertyAssign__PROPERTY_ATTRIBUTE = mx::PropertyAssign::PROPERTY_ATTRIBUTE;
28+
std::string mx__PropertyAssign__GEOM_ATTRIBUTE = mx::PropertyAssign::GEOM_ATTRIBUTE;
29+
std::string mx__PropertyAssign__COLLECTION_ATTRIBUTE = mx::PropertyAssign::COLLECTION_ATTRIBUTE;
30+
2731
ems::class_<mx::PropertyAssign, ems::base<mx::ValueElement>>("PropertyAssign")
2832
.smart_ptr_constructor("PropertyAssign", &std::make_shared<mx::PropertyAssign, mx::ElementPtr, const std::string &>)
2933
.smart_ptr<std::shared_ptr<const mx::PropertyAssign>>("PropertyAssign")
@@ -39,9 +43,9 @@ EMSCRIPTEN_BINDINGS(property)
3943
.function("setCollection", &mx::PropertyAssign::setCollection)
4044
.function("getCollection", &mx::PropertyAssign::getCollection)
4145
.class_property("CATEGORY", &mx::PropertyAssign::CATEGORY)
42-
.class_property("PROPERTY_ATTRIBUTE", &mx::PropertyAssign::PROPERTY_ATTRIBUTE)
43-
.class_property("GEOM_ATTRIBUTE", &mx::PropertyAssign::GEOM_ATTRIBUTE)
44-
.class_property("COLLECTION_ATTRIBUTE", &mx::PropertyAssign::COLLECTION_ATTRIBUTE);
46+
.class_property("PROPERTY_ATTRIBUTE", &mx__PropertyAssign__PROPERTY_ATTRIBUTE)
47+
.class_property("GEOM_ATTRIBUTE", &mx__PropertyAssign__GEOM_ATTRIBUTE)
48+
.class_property("COLLECTION_ATTRIBUTE", &mx__PropertyAssign__COLLECTION_ATTRIBUTE);
4549

4650
ems::class_<mx::PropertySet, ems::base<mx::Element>>("PropertySet")
4751
.smart_ptr_constructor("PropertySet", &std::make_shared<mx::PropertySet, mx::ElementPtr, const std::string &>)
@@ -67,7 +71,9 @@ EMSCRIPTEN_BINDINGS(property)
6771
BIND_PROPERTYSET_TYPE_INSTANCE(StringArray, mx::StringVec)
6872
.function("getPropertyValue", &mx::PropertySet::getPropertyValue)
6973
.class_property("CATEGORY", &mx::Property::CATEGORY);
70-
74+
75+
std::string mx__PropertySetAssign__COLLECTION_ATTRIBUTE = mx::PropertySetAssign::PROPERTY_SET_ATTRIBUTE;
76+
7177
ems::class_<mx::PropertySetAssign, ems::base<mx::GeomElement>>("PropertySetAssign")
7278
.smart_ptr_constructor("PropertySetAssign", &std::make_shared<mx::PropertySetAssign, mx::ElementPtr, const std::string &>)
7379
.smart_ptr<std::shared_ptr<const mx::PropertySetAssign>>("PropertySetAssign")
@@ -77,5 +83,5 @@ EMSCRIPTEN_BINDINGS(property)
7783
.function("setPropertySet", &mx::PropertySetAssign::setPropertySet)
7884
.function("getPropertySet", &mx::PropertySetAssign::getPropertySet)
7985
.class_property("CATEGORY", &mx::PropertySetAssign::CATEGORY)
80-
.class_property("PROPERTY_SET_ATTRIBUTE", &mx::PropertySetAssign::PROPERTY_SET_ATTRIBUTE);
86+
.class_property("PROPERTY_SET_ATTRIBUTE", &mx__PropertySetAssign__COLLECTION_ATTRIBUTE);
8187
}

source/MaterialXCore/Property.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
MATERIALX_NAMESPACE_BEGIN
99

10-
const string PropertyAssign::PROPERTY_ATTRIBUTE = "property";
11-
const string PropertyAssign::GEOM_ATTRIBUTE = "geom";
12-
const string PropertyAssign::COLLECTION_ATTRIBUTE = "collection";
13-
const string PropertySetAssign::PROPERTY_SET_ATTRIBUTE = "propertyset";
10+
const char* PropertyAssign::PROPERTY_ATTRIBUTE = "property";
11+
const char* PropertyAssign::GEOM_ATTRIBUTE = "geom";
12+
const char* PropertyAssign::COLLECTION_ATTRIBUTE = "collection";
13+
const char* PropertySetAssign::PROPERTY_SET_ATTRIBUTE = "propertyset";
1414

1515
//
1616
// PropertyAssign methods

source/MaterialXCore/Property.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ class MX_CORE_API PropertyAssign : public ValueElement
141141

142142
public:
143143
static const string CATEGORY;
144-
static const string PROPERTY_ATTRIBUTE;
145-
static const string GEOM_ATTRIBUTE;
146-
static const string COLLECTION_ATTRIBUTE;
144+
static const char* PROPERTY_ATTRIBUTE;
145+
static const char* GEOM_ATTRIBUTE;
146+
static const char* COLLECTION_ATTRIBUTE;
147147
};
148148

149149
/// @class PropertySet
@@ -263,7 +263,7 @@ class MX_CORE_API PropertySetAssign : public GeomElement
263263

264264
public:
265265
static const string CATEGORY;
266-
static const string PROPERTY_SET_ATTRIBUTE;
266+
static const char* PROPERTY_SET_ATTRIBUTE;
267267
};
268268

269269
MATERIALX_NAMESPACE_END

0 commit comments

Comments
 (0)