Commit ae1c539f authored by Volker Krause's avatar Volker Krause Committed by Torsten Rahn
Browse files

Work around MARBLE_ADD_WRITER not working in static builds

This relies on being executed during plugin loading, but in a static build
it's either executed too early when the called code isn't ready yet (which
crashes), or not at all.

This can probably be done nicer by refactoring this to avoid relying on
static construction, but given this is only actually used in one single
place handling this manually for the Tirex backend is good enough.
parent 0db1ac4e
......@@ -50,8 +50,12 @@ private:
QString m_fileExtension;
};
#ifndef STATIC_BUILD
#define MARBLE_ADD_WRITER(Class, fileExtension) \
static GeoWriterBackendRegistrar s_##Class##Registrar(new Class, fileExtension);
#else
#define MARBLE_ADD_WRITER(Class, fileExtension)
#endif
}
......
......@@ -16,6 +16,9 @@
#include "TileId.h"
#include "VectorClipper.h"
#include "WayConcatenator.h"
#ifdef STATIC_BUILD
#include "src/plugins/runner/osm/translators/O5mWriter.h"
#endif
#include <QCommandLineParser>
#include <QCoreApplication>
......@@ -67,6 +70,11 @@ int main(int argc, char **argv)
});
parser.process(app);
// work around MARBLE_ADD_WRITER not working for static builds
#ifdef STATIC_BUILD
GeoDataDocumentWriter::registerWriter(new O5mWriter, QStringLiteral("o5m"));
#endif
TirexBackend backend;
MarbleModel model;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment