summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--compat/compat.h12
-rw-r--r--ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx7
-rw-r--r--ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx4
4 files changed, 21 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc734e43..6385f04d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -416,6 +416,9 @@ endif()
if(NOT SDK_WINE_NO_WRAPPER)
add_custom_command(
OUTPUT opentrack-wrapper-wine.exe.so
+ DEPENDS "${CMAKE_SOURCE_DIR}/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx"
+ "${CMAKE_SOURCE_DIR}/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx"
+ "${CMAKE_SOURCE_DIR}/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx"
COMMAND "${SDK_WINE_PREFIX}/bin/wineg++" -g -O2 -m32 -o
opentrack-wrapper-wine.exe -I "${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/ftnoir_protocol_wine/opentrack-wrapper-wine-main.cxx"
@@ -423,6 +426,7 @@ endif()
"${CMAKE_SOURCE_DIR}/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx"
-lrt)
add_custom_target(wine-wrapper ALL DEPENDS opentrack-wrapper-wine.exe.so)
+ add_dependencies(wine-wrapper opentrack-compat opentrack-proto-wine)
endif()
endif()
diff --git a/compat/compat.h b/compat/compat.h
index c34add10..3d54ae1d 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -19,10 +19,14 @@
#include <sys/types.h>
#endif
-#if defined(IN_FTNOIR_COMPAT) && defined(_WIN32)
-# define COMPAT_EXPORT __declspec(dllexport)
-#elif defined(_WIN32)
-# define COMPAT_EXPORT __declspec(dllimport)
+#if !defined(OPENTRACK_COMPAT_BUNDLED)
+# if defined(IN_FTNOIR_COMPAT) && defined(_WIN32)
+# define COMPAT_EXPORT __declspec(dllexport)
+# elif defined(_WIN32)
+# define COMPAT_EXPORT __declspec(dllimport)
+# else
+# define COMPAT_EXPORT
+# endif
#else
# define COMPAT_EXPORT
#endif
diff --git a/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx b/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx
index c88dd332..42d39ff2 100644
--- a/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx
+++ b/ftnoir_protocol_wine/opentrack-wrapper-wine-posix.cxx
@@ -1,9 +1,12 @@
+#define OPENTRACK_COMPAT_BUNDLED
#ifdef _WIN32
-#undef _WIN32
+# undef _WIN32
#endif
+
#ifdef __WIN32
-#undef __WIN32
+# undef __WIN32
#endif
+
#define PortableLockedShm ShmPosix
#include "compat/compat.h"
#include "compat/compat.cpp"
diff --git a/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx b/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx
index 6d5484a9..e7102600 100644
--- a/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx
+++ b/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx
@@ -1,7 +1,11 @@
+#define OPENTRACK_COMPAT_BUNDLED
+
#ifndef __WIN32
#define __WIN32
#endif
+
#define PortableLockedShm ShmWine
+
#include "ftnoir_protocol_ft/fttypes.h"
#include "compat/compat.h"
#include "compat/compat.cpp"