diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-17 21:22:35 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-18 08:33:40 +0200 |
commit | b20695380f8cc65d8b58cd524f296382ba8ef2e7 (patch) | |
tree | ef2098765d97a9397254c3145b87f05655d69474 /video/camera.hpp | |
parent | 18e7302cc6dc6611acce4b87972da9e393ba15c7 (diff) |
video: workaround cmake/ninja bug
Diffstat (limited to 'video/camera.hpp')
-rw-r--r-- | video/camera.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/video/camera.hpp b/video/camera.hpp index a0fe0adb..d4d17c8f 100644 --- a/video/camera.hpp +++ b/video/camera.hpp @@ -75,9 +75,17 @@ void register_camera(std::unique_ptr<impl::camera_> metadata); static const char init_ ## ctr = \ (::video::impl::register_camera(std::make_unique<type>()), 0); -#define OTR_REGISTER_CAMERA2(type, ctr) \ - OTR_REGISTER_CAMERA3(type, ctr) +#ifdef _MSC_VER + // shared library targets without any symbols break cmake build +# define OTR_REGISTER_CAMERA_IMPL() \ + extern "C" __declspec(dllexport) [[maybe_unused]] void _opentrack_module(void) {} +#else +# define OTR_REGISTER_CAMERA_IMPL() +#endif +#define OTR_REGISTER_CAMERA2(type, ctr) \ + OTR_REGISTER_CAMERA3(type, ctr) \ + OTR_REGISTER_CAMERA_IMPL() #define OTR_REGISTER_CAMERA(type) \ OTR_REGISTER_CAMERA2(type, __COUNTER__) |