From a1df420f4f09512470c2a7a24bc93ead4571368c Mon Sep 17 00:00:00 2001 From: tompollok Date: Tue, 16 Jun 2020 20:49:06 +0200 Subject: [PATCH 1/3] add __declspec to cvsba.h to support lib generation in windows --- src/cvsba.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cvsba.h b/src/cvsba.h index 192953c..341540e 100644 --- a/src/cvsba.h +++ b/src/cvsba.h @@ -28,7 +28,7 @@ #include namespace cvsba { -class Sba { +class __declspec(dllexport) Sba { public: // TYPE type: type of bundle adjustment optimization. Posible values: From 450d95263bccee4ea6755d2d5d3af23bb88c1eee Mon Sep 17 00:00:00 2001 From: tompollok Date: Thu, 18 Jun 2020 16:35:47 +0200 Subject: [PATCH 2/3] use libcvsba_export.h for declspec definition via LIBCVSBA_EXPORT --- src/cvsba.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cvsba.h b/src/cvsba.h index 341540e..367e376 100644 --- a/src/cvsba.h +++ b/src/cvsba.h @@ -26,9 +26,12 @@ #include #include #include + +#include "libcvsba_export.h" + namespace cvsba { -class __declspec(dllexport) Sba { +class LIBCVSBA_EXPORT Sba { public: // TYPE type: type of bundle adjustment optimization. Posible values: From b4b06b21fe7af1be160a1277493407db4e5d9ab0 Mon Sep 17 00:00:00 2001 From: tompollok Date: Thu, 18 Jun 2020 16:39:05 +0200 Subject: [PATCH 3/3] add libcvsba_export.h to support declspec platform independently --- src/libcvsba_export.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/libcvsba_export.h diff --git a/src/libcvsba_export.h b/src/libcvsba_export.h new file mode 100644 index 0000000..6486bd3 --- /dev/null +++ b/src/libcvsba_export.h @@ -0,0 +1,29 @@ +#ifndef LIBCVSBA_EXPORT_H +#define LIBCVSBA_EXPORT_H + + +#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__) +# ifdef LIBCVSBA_STATIC_DEFINE +# define LIBCVSBA_EXPORT +# define LIBCVSBA_NO_EXPORT +# else +# ifndef LIBCVSBA_EXPORT +# ifdef LIBCVSBA_EXPORTS + /* We are building this library */ +# define LIBCVSBA_EXPORT __declspec(dllexport) +# else + /* We are using this library */ +# define LIBCVSBA_EXPORT __declspec(dllimport) +# endif +# endif + +# ifndef LIBCVSBA_NO_EXPORT +# define LIBCVSBA_NO_EXPORT +# endif +# endif +#else +# define LIBCVSBA_EXPORT +# define LIBCVSBA_NO_EXPORT +#endif + +#endif