From 0760fe011114fa440275b487eaf766b015f40e5b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 16 Jun 2016 12:34:31 +0200 Subject: all: split "api" into "api" and "logic" Here, the "logic" module has all the stuff for building one's own graphical user interface. The "api" module has stuff used by other trackers. While at it, each of "api", "logic", and "compat" need their own export headers. This is because of preprocessor symbol clashes. This is all because a change in the "gui"-only dependency required a relink of all the trackers, protocols, and flters. It takes too long when building in the release configuration. With the split, only the "gui" module gets rebuilt. Since it has close to no static dependencies, it's fast enough. --- opentrack-compat/camera-names.hpp | 6 +----- opentrack-compat/export.hpp | 8 +++++--- opentrack-compat/import.hpp | 20 +++++++++----------- opentrack-compat/options.hpp | 6 +----- opentrack-compat/shm.h | 6 +----- opentrack-compat/timer.hpp | 6 +++++- 6 files changed, 22 insertions(+), 30 deletions(-) (limited to 'opentrack-compat') diff --git a/opentrack-compat/camera-names.hpp b/opentrack-compat/camera-names.hpp index c2879000..ae0c6b25 100644 --- a/opentrack-compat/camera-names.hpp +++ b/opentrack-compat/camera-names.hpp @@ -11,11 +11,7 @@ #include #include -#ifdef BUILD_compat -# include "compat-export.hpp" -#else -# include "compat-import.hpp" -#endif +#include "export.hpp" OPENTRACK_COMPAT_EXPORT QList get_camera_names(); OPENTRACK_COMPAT_EXPORT int camera_name_to_index(const QString &name); diff --git a/opentrack-compat/export.hpp b/opentrack-compat/export.hpp index 100950a0..fbb62e1f 100644 --- a/opentrack-compat/export.hpp +++ b/opentrack-compat/export.hpp @@ -1,6 +1,6 @@ #pragma once -#ifndef OPENTRACK_EXPORT +#ifdef BUILD_compat # ifdef _WIN32 # define OPENTRACK_LINKAGE __declspec(dllexport) # else @@ -8,8 +8,10 @@ # endif # ifndef _MSC_VER -# define OPENTRACK_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_LINKAGE +# define OPENTRACK_COMPAT_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_LINKAGE # else -# define OPENTRACK_EXPORT OPENTRACK_LINKAGE +# define OPENTRACK_COMPAT_EXPORT OPENTRACK_LINKAGE # endif +#else +# include "import.hpp" #endif diff --git a/opentrack-compat/import.hpp b/opentrack-compat/import.hpp index 3747b141..1b4aa8f1 100644 --- a/opentrack-compat/import.hpp +++ b/opentrack-compat/import.hpp @@ -1,15 +1,13 @@ #pragma once -#ifndef OPENTRACK_EXPORT -# ifdef _WIN32 -# define OPENTRACK_LINKAGE __declspec(dllimport) -# else -# define OPENTRACK_LINKAGE -# endif +#ifdef _WIN32 +# define OPENTRACK_LINKAGE __declspec(dllimport) +#else +# define OPENTRACK_LINKAGE +#endif -# ifndef _MSC_VER -# define OPENTRACK_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_LINKAGE -# else -# define OPENTRACK_EXPORT OPENTRACK_LINKAGE -# endif +#ifndef _MSC_VER +# define OPENTRACK_COMPAT_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_LINKAGE +#else +# define OPENTRACK_COMPAT_EXPORT OPENTRACK_LINKAGE #endif diff --git a/opentrack-compat/options.hpp b/opentrack-compat/options.hpp index 17ab093c..b8db411a 100644 --- a/opentrack-compat/options.hpp +++ b/opentrack-compat/options.hpp @@ -42,11 +42,7 @@ #include -#ifdef BUILD_compat -# include "compat-export.hpp" -#else -# include "compat-import.hpp" -#endif +#include "export.hpp" template using mem = std::shared_ptr; diff --git a/opentrack-compat/shm.h b/opentrack-compat/shm.h index 3edb0080..c7af4ac7 100644 --- a/opentrack-compat/shm.h +++ b/opentrack-compat/shm.h @@ -24,11 +24,7 @@ # pragma GCC diagnostic ignored "-Wattributes" #endif -#ifdef BUILD_compat -# include "compat-export.hpp" -#else -# include "compat-import.hpp" -#endif +#include "export.hpp" class OPENTRACK_COMPAT_EXPORT PortableLockedShm { public: diff --git a/opentrack-compat/timer.hpp b/opentrack-compat/timer.hpp index 4f7e8d2e..c048844c 100644 --- a/opentrack-compat/timer.hpp +++ b/opentrack-compat/timer.hpp @@ -8,6 +8,9 @@ #pragma once #include + +#include "export.hpp" + #if defined (_WIN32) # include # ifndef CLOCK_MONOTONIC @@ -52,7 +55,8 @@ static inline void clock_gettime(int, struct timespec* ts) } # endif #endif -class Timer { +class OPENTRACK_COMPAT_EXPORT Timer +{ private: struct timespec state; long long conv(const struct timespec& cur) const -- cgit v1.2.3