From cc16fd0121fe79ae1fd9539a606c19827f64bc23 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 1 Nov 2015 08:36:28 +0100 Subject: use newly-added preprocessor variable --- csv/csv.cpp | 1 - csv/csv.h | 9 ++++++++- opentrack-compat/shm.h | 9 ++++++++- pose-widget/glwidget.h | 9 ++++++++- qxt-mini/CMakeLists.txt | 5 +---- qxt-mini/qxtglobal.h | 6 ++++++ spline-widget/functionconfig.h | 9 ++++++++- spline-widget/qfunctionconfigurator.h | 4 ++-- 8 files changed, 41 insertions(+), 11 deletions(-) diff --git a/csv/csv.cpp b/csv/csv.cpp index 2193ed80..26a36b70 100644 --- a/csv/csv.cpp +++ b/csv/csv.cpp @@ -8,7 +8,6 @@ * purpose with or without fee is hereby granted, provided that the above * * copyright notice and this permission notice appear in all copies. * */ -#define INSIDE_CSV #include "csv.h" #include #include diff --git a/csv/csv.h b/csv/csv.h index a896a076..7ae1ad5c 100644 --- a/csv/csv.h +++ b/csv/csv.h @@ -1,4 +1,5 @@ #pragma once +#include #include #include #include @@ -6,7 +7,13 @@ #include #include -class CSV +#ifdef BUILD_opentrack_csv +# define CSV_EXPORT Q_DECL_EXPORT +#else +# define CSV_EXPORT Q_DECL_IMPORT +#endif + +class CSV_EXPORT CSV { public: QString readLine(); diff --git a/opentrack-compat/shm.h b/opentrack-compat/shm.h index 17a0d843..7c8a66a9 100644 --- a/opentrack-compat/shm.h +++ b/opentrack-compat/shm.h @@ -18,8 +18,15 @@ #include #include #endif +#include -class PortableLockedShm { +#ifdef BUILD_opentrack_compat +# define COMPAT_EXPORT Q_DECL_EXPORT +#else +# define COMPAT_EXPORT Q_DECL_IMPORT +#endif + +class COMPAT_EXPORT PortableLockedShm { public: PortableLockedShm(const char *shmName, const char *mutexName, int mapSize); ~PortableLockedShm(); diff --git a/pose-widget/glwidget.h b/pose-widget/glwidget.h index 81517399..fca3502d 100644 --- a/pose-widget/glwidget.h +++ b/pose-widget/glwidget.h @@ -7,12 +7,19 @@ #pragma once +#include #include #include #include "opentrack/plugin-api.hpp" #include "opentrack/simple-mat.hpp" -class GLWidget : public QWidget +#ifdef BUILD_opentrack_pose_widget +# define POSE_WIDGET_EXPORT Q_DECL_EXPORT +#else +# define POSE_WIDGET_EXPORT Q_DECL_IMPORT +#endif + +class POSE_WIDGET_EXPORT GLWidget : public QWidget { public: using num = float; diff --git a/qxt-mini/CMakeLists.txt b/qxt-mini/CMakeLists.txt index 2fe5993b..5de29cd1 100644 --- a/qxt-mini/CMakeLists.txt +++ b/qxt-mini/CMakeLists.txt @@ -1,8 +1,5 @@ if(UNIX OR APPLE) - opentrack_boilerplate(opentrack-qxt-mini - NO-LINKER-SCRIPT NO-COMPAT - COMPILE "-DQXT_BUILD -DBUILD_QXT_GUI" - ) + opentrack_boilerplate(opentrack-qxt-mini NO-LINKER-SCRIPT NO-COMPAT) if(NOT APPLE) target_link_libraries(opentrack-qxt-mini X11) else() diff --git a/qxt-mini/qxtglobal.h b/qxt-mini/qxtglobal.h index 574482ae..64fd35dc 100644 --- a/qxt-mini/qxtglobal.h +++ b/qxt-mini/qxtglobal.h @@ -51,6 +51,12 @@ #define QXT_DLLEXPORT DO_NOT_USE_THIS_ANYMORE +#ifdef BUILD_opentrack_qxt_mini +# define QXT_BUILD +# define BUILD_QXT_GUI +# define BUILD_QXT +#endif + #ifdef QXT_BUILD # if defined(BUILD_QXT_CORE) # define QXT_CORE_EXPORT Q_DECL_EXPORT diff --git a/spline-widget/functionconfig.h b/spline-widget/functionconfig.h index 6d76d0de..3d2fc23c 100644 --- a/spline-widget/functionconfig.h +++ b/spline-widget/functionconfig.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -17,7 +18,13 @@ #include #include "opentrack-compat/qcopyable-mutex.hpp" -class Map { +#ifdef BUILD_opentrack_spline_widget +# define SPLINE_WIDGET_EXPORT Q_DECL_EXPORT +#else +# define SPLINE_WIDGET_EXPORT Q_DECL_IMPORT +#endif + +class SPLINE_WIDGET_EXPORT Map { private: static constexpr int value_count = 10000; diff --git a/spline-widget/qfunctionconfigurator.h b/spline-widget/qfunctionconfigurator.h index baea9e34..4a9cb5f1 100644 --- a/spline-widget/qfunctionconfigurator.h +++ b/spline-widget/qfunctionconfigurator.h @@ -12,10 +12,10 @@ #include #include #include -#include "spline-widget/functionconfig.h" +#include "functionconfig.h" #include "opentrack/plugin-api.hpp" -class QFunctionConfigurator : public QWidget +class SPLINE_WIDGET_EXPORT QFunctionConfigurator : public QWidget { Q_OBJECT Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier) -- cgit v1.2.3