diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-17 18:43:43 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-17 18:43:43 +0200 |
commit | 9aae1ab9c99a95dfd98d1c676ed4ff1d23691476 (patch) | |
tree | eb831388dd000b922bacdb1541de7162f7c7bbed | |
parent | 6711d08ff580206ec38b4f4a0deb1a04a16de431 (diff) |
x-plane-plugin: set default visibility. remove linker script.
-rw-r--r-- | x-plane-plugin/CMakeLists.txt | 7 | ||||
-rw-r--r-- | x-plane-plugin/plugin.c | 12 | ||||
-rw-r--r-- | x-plane-plugin/version-script.txt | 10 |
3 files changed, 11 insertions, 18 deletions
diff --git a/x-plane-plugin/CMakeLists.txt b/x-plane-plugin/CMakeLists.txt index de42b5a5..a58c76a9 100644 --- a/x-plane-plugin/CMakeLists.txt +++ b/x-plane-plugin/CMakeLists.txt @@ -6,17 +6,18 @@ if(LINUX OR APPLE) # probably librt already included add_library(opentrack-xplane-plugin SHARED ${opentrack-xplane-plugin-c}) target_include_directories(opentrack-xplane-plugin SYSTEM PUBLIC ${SDK_XPLANE}/CHeaders ${SDK_XPLANE}/CHeaders/XPLM) + set(vis "-fvisibility=hidden") if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC AND NOT APPLE) SET_TARGET_PROPERTIES(opentrack-xplane-plugin PROPERTIES LINK_FLAGS - "-Wl,--version-script=${CMAKE_SOURCE_DIR}/x-plane-plugin/version-script.txt -shared -rdynamic -nodefaultlibs -undefined_warning -fPIC" - COMPILE_FLAGS "-Wall -O2 -pipe -fPIC -DLIN -DXPLM200 -DXPLM210" + "-shared -rdynamic -nodefaultlibs -undefined_warning -fPIC" + COMPILE_FLAGS "${vis} -Wall -O2 -pipe -fPIC -DLIN -DXPLM200 -DXPLM210" LIBRARY_OUTPUT_NAME "opentrack.xpl" PREFIX "" SUFFIX "") endif() if(APPLE) SET_TARGET_PROPERTIES(opentrack-xplane-plugin PROPERTIES - COMPILE_FLAGS "-iframework ${SDK_XPLANE}/Libraries/Mac/ -DAPL -DXPLM200 -DXPLM210 -framework XPLM -framework XPWidgets" + COMPILE_FLAGS "${vis} -iframework ${SDK_XPLANE}/Libraries/Mac/ -DAPL -DXPLM200 -DXPLM210 -framework XPLM -framework XPWidgets" LINK_FLAGS "-F${SDK_XPLANE}/Libraries/Mac/ -framework XPLM -framework XPWidgets" LIBRARY_OUTPUT_NAME "opentrack.xpl" PREFIX "" SUFFIX "") diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c index c091f74d..4d4c6c92 100644 --- a/x-plane-plugin/plugin.c +++ b/x-plane-plugin/plugin.c @@ -22,6 +22,8 @@ #define WINE_SHM_NAME "facetracknoir-wine-shm" #define WINE_MTX_NAME "facetracknoir-wine-mtx" +#include "../opentrack-compat/export.hpp" + enum Axis { TX = 0, TY, TZ, Yaw, Pitch, Roll }; @@ -147,7 +149,7 @@ static int TranslationToggleHandler( XPLMCommandRef inCommand, return 0; } -PLUGIN_API int XPluginStart ( char * outName, char * outSignature, char * outDescription ) { +PLUGIN_API OPENTRACK_EXPORT int XPluginStart ( char * outName, char * outSignature, char * outDescription ) { view_x = XPLMFindDataRef("sim/aircraft/view/acf_peX"); view_y = XPLMFindDataRef("sim/aircraft/view/acf_peY"); view_z = XPLMFindDataRef("sim/aircraft/view/acf_peZ"); @@ -185,7 +187,7 @@ PLUGIN_API int XPluginStart ( char * outName, char * outSignature, char * outDes return 0; } -PLUGIN_API void XPluginStop ( void ) { +PLUGIN_API OPENTRACK_EXPORT void XPluginStop ( void ) { if (lck_posix) { PortableLockedShm_free(lck_posix); @@ -194,17 +196,17 @@ PLUGIN_API void XPluginStop ( void ) { } } -PLUGIN_API void XPluginEnable ( void ) { +PLUGIN_API OPENTRACK_EXPORT void XPluginEnable ( void ) { XPLMRegisterFlightLoopCallback(write_head_position, -1.0, NULL); track_disabled = 0; } -PLUGIN_API void XPluginDisable ( void ) { +PLUGIN_API OPENTRACK_EXPORT void XPluginDisable ( void ) { XPLMUnregisterFlightLoopCallback(write_head_position, NULL); track_disabled = 1; } -PLUGIN_API void XPluginReceiveMessage( +PLUGIN_API OPENTRACK_EXPORT void XPluginReceiveMessage( XPLMPluginID OT_UNUSED(inFromWho), int OT_UNUSED(inMessage), void * OT_UNUSED(inParam)) diff --git a/x-plane-plugin/version-script.txt b/x-plane-plugin/version-script.txt deleted file mode 100644 index cfb84ec8..00000000 --- a/x-plane-plugin/version-script.txt +++ /dev/null @@ -1,10 +0,0 @@ -{ - global: - XPluginStart; - XPluginStop; - XPluginEnable; - XPluginDisable; - XPluginReceiveMessage; - local: - *; -}; |