Add missing exports for ifcopenshell-python when we build shared libs.

This commit is contained in:
Adrien SCHVALBERG
2022-05-03 11:38:12 +02:00
committed by Thomas Krijnen
parent 7e28d193ec
commit 42448cae4e
11 changed files with 59 additions and 11 deletions
+4 -2
View File
@@ -19,6 +19,8 @@
#include "../ifcparse/IfcSchema.h"
#include "ifc_parse_api.h"
#ifndef ARGUMENTTYPE_H
#define ARGUMENTTYPE_H
@@ -51,8 +53,8 @@ namespace IfcUtil {
Argument_UNKNOWN
};
ArgumentType from_parameter_type(const IfcParse::parameter_type*);
ArgumentType make_aggregate(ArgumentType elem_type);
IFC_PARSE_API ArgumentType from_parameter_type(const IfcParse::parameter_type*);
IFC_PARSE_API ArgumentType make_aggregate(ArgumentType elem_type);
}
#endif
+2
View File
@@ -72,6 +72,8 @@
}
}
%include "../serializers/serializers_api.h"
// Include headers for the typemaps to function. This set of includes,
// can probably be reduced, but for now it's identical to the includes
// of the module definition below.
+2 -1
View File
@@ -43,13 +43,14 @@
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
#include "../serializers/serializers_api.h"
#include "../ifcgeom_schema_agnostic/GeometrySerializer.h"
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
class ColladaSerializer : public WriteOnlyGeometrySerializer
class SERIALIZERS_API ColladaSerializer : public WriteOnlyGeometrySerializer
{
// TODO The vast amount of implement details of ColladaSerializer could be hidden to the cpp file.
private:
+2 -1
View File
@@ -22,6 +22,7 @@
#ifdef WITH_GLTF
#include "../serializers/serializers_api.h"
#include "../ifcgeom_schema_agnostic/GeometrySerializer.h"
#include <nlohmann/json.hpp>
@@ -29,7 +30,7 @@ using json = nlohmann::json;
#include <map>
class GltfSerializer : public WriteOnlyGeometrySerializer {
class SERIALIZERS_API GltfSerializer : public WriteOnlyGeometrySerializer {
private:
std::string filename_, tmp_filename1_, tmp_filename2_;
std::ofstream fstream_, tmp_fstream1_, tmp_fstream2_;
+2 -1
View File
@@ -28,11 +28,12 @@
#include "H5Cpp.h"
#include "../serializers/serializers_api.h"
#include "../ifcgeom_schema_agnostic/GeometrySerializer.h"
#define USE_BINARY
class HdfSerializer : public GeometrySerializer {
class SERIALIZERS_API HdfSerializer : public GeometrySerializer {
private:
const std::string hdf_filename;
unsigned int vcount_total;
+2 -1
View File
@@ -20,11 +20,12 @@
#ifndef OPENCASCADEBASEDSERIALIZER_H
#define OPENCASCADEBASEDSERIALIZER_H
#include "../serializers/serializers_api.h"
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
#include "../ifcgeom_schema_agnostic/GeometrySerializer.h"
class OpenCascadeBasedSerializer : public WriteOnlyGeometrySerializer {
class SERIALIZERS_API OpenCascadeBasedSerializer : public WriteOnlyGeometrySerializer {
OpenCascadeBasedSerializer(const OpenCascadeBasedSerializer&); //N/A
OpenCascadeBasedSerializer& operator =(const OpenCascadeBasedSerializer&); //N/A
protected:
+2 -1
View File
@@ -23,6 +23,7 @@
#define SVGSERIALIZER_H
#include "../ifcgeom_schema_agnostic/GeometrySerializer.h"
#include "../serializers/serializers_api.h"
#include "../serializers/util.h"
#include "../ifcparse/utils.h"
@@ -135,7 +136,7 @@ typedef boost::variant<
Handle(HLRBRep_PolyAlgo)
> hlr_t;
class SvgSerializer : public WriteOnlyGeometrySerializer {
class SERIALIZERS_API SvgSerializer : public WriteOnlyGeometrySerializer {
public:
typedef std::pair<std::string, std::vector<util::string_buffer> > path_object;
typedef std::vector< boost::shared_ptr<util::string_buffer::float_item> > float_item_list;
+2 -1
View File
@@ -24,10 +24,11 @@
#include <string>
#include <fstream>
#include "../serializers/serializers_api.h"
#include "../ifcgeom_schema_agnostic/GeometrySerializer.h"
// http://people.sc.fsu.edu/~jburkardt/txt/obj_format.txt
class WaveFrontOBJSerializer : public WriteOnlyGeometrySerializer {
class SERIALIZERS_API WaveFrontOBJSerializer : public WriteOnlyGeometrySerializer {
private:
stream_or_filename obj_stream;
stream_or_filename mtl_stream;
+3 -2
View File
@@ -1,5 +1,6 @@
#define SCHEMA_METHOD
#include "../serializers/serializers_api.h"
#include "../ifcgeom_schema_agnostic/Serializer.h"
#include "../ifcparse/IfcFile.h"
@@ -7,7 +8,7 @@
#include <map>
class XmlSerializer : public Serializer {
class SERIALIZERS_API XmlSerializer : public Serializer {
private:
XmlSerializer* implementation_;
@@ -26,7 +27,7 @@ public:
void setFile(IfcParse::IfcFile*) { throw IfcParse::IfcException("Should be supplied on construction"); }
};
struct XmlSerializerFactory {
struct SERIALIZERS_API XmlSerializerFactory {
typedef boost::function2<XmlSerializer*, IfcParse::IfcFile*, std::string> fn;
class Factory : public std::map<std::string, fn> {
+37
View File
@@ -0,0 +1,37 @@
/********************************************************************************
* *
* 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/>. *
* *
********************************************************************************/
#ifndef IFC_SERIALIZERS_API_H
#define IFC_SERIALIZERS_API_H
#ifdef IFC_SHARED_BUILD
#ifdef _WIN32
#ifdef Serializers_EXPORTS
#define SERIALIZERS_API __declspec(dllexport)
#else
#define SERIALIZERS_API __declspec(dllimport)
#endif
#else // simply assume *nix + GCC-like compiler
#define SERIALIZERS_API __attribute__((visibility("default")))
#endif
#else
#define SERIALIZERS_API
#endif
#endif