diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-30 17:54:51 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-30 17:54:51 +0100 |
commit | 181875f3385391aed537c7e5fcff8fda199d39e6 (patch) | |
tree | 60ed7ecfc4d7be7a7c126dab6e20988882c23638 | |
parent | 4501ea093dadd3c44e88da9901eff683b0a91614 (diff) |
use version script
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | opentrack-api/gnuc-version-script.txt | 12 | ||||
-rw-r--r-- | opentrack-api/opentrack.h | 20 |
3 files changed, 23 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3084bdfd..239cafb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -614,6 +614,10 @@ configure_file("${CMAKE_SOURCE_DIR}/opentrack-version.h" "${CMAKE_BINARY_DIR}/op add_library(opentrack-api SHARED ${opentrack-lib-c} ${opentrack-lib-h} ${opentrack-lib-moc}) target_link_libraries(opentrack-api ${MY_QT_LIBS}) +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) + SET_TARGET_PROPERTIES(opentrack-api + PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/opentrack-api/gnuc-version-script.txt") +endif() set_target_properties(opentrack PROPERTIES COMPILE_DEFINITIONS OPENTRACK_VERSION=\"${OPENTRACK__COMMIT}\") diff --git a/opentrack-api/gnuc-version-script.txt b/opentrack-api/gnuc-version-script.txt new file mode 100644 index 00000000..cd3a568d --- /dev/null +++ b/opentrack-api/gnuc-version-script.txt @@ -0,0 +1,12 @@ +{ + global: + opentrack_make_ctx; + opentrack_finalize_ctx; + opentrack_enum_trackers; + opentrack_make_tracker; + opentrack_tracker_start; + opentrack_tracker_tick; + opentrack_finalize_tracker; + local: + *; +}; diff --git a/opentrack-api/opentrack.h b/opentrack-api/opentrack.h index 95339d08..8d28b5b8 100644 --- a/opentrack-api/opentrack.h +++ b/opentrack-api/opentrack.h @@ -25,12 +25,6 @@ typedef opentrack_opaque_tracker* opentrack_tracker; # endif #endif -#ifdef __GNUC__ -# define OPENTRACK_VISIBLE __attribute__((visibility ("default"))) -#else -# define OPENTRACK_VISIBLE -#endif - /* for `opentrack_tracker_tick', individual headpose elts */ #ifndef IN_OPENTRACK enum opentrack_dof { @@ -44,20 +38,20 @@ enum opentrack_dof { }; #endif -opentrack OPENTRACK_VISIBLE opentrack_make_ctx(const char* dir); -void OPENTRACK_VISIBLE opentrack_finalize_ctx(opentrack self); +opentrack opentrack_make_ctx(const char* dir); +void opentrack_finalize_ctx(opentrack self); /* no need to free the return value; invalid to modify it */ -const char** OPENTRACK_VISIBLE opentrack_enum_trackers(opentrack self); +const char** opentrack_enum_trackers(opentrack self); /* * don't `opentrack_tracker_tick an unstarted tracker, it's invalid to do so * it's also invalid to start a finalized tracker */ -opentrack_tracker OPENTRACK_VISIBLE opentrack_make_tracker(opentrack ctx, const char* name); -void OPENTRACK_VISIBLE opentrack_tracker_start(opentrack self, opentrack_tracker tracker); -int OPENTRACK_VISIBLE opentrack_tracker_tick(opentrack_tracker tracker, double* headpose); -void OPENTRACK_VISIBLE opentrack_finalize_tracker(opentrack_tracker tracker); +opentrack_tracker opentrack_make_tracker(opentrack ctx, const char* name); +void opentrack_tracker_start(opentrack self, opentrack_tracker tracker); +int opentrack_tracker_tick(opentrack_tracker tracker, double* headpose); +void opentrack_finalize_tracker(opentrack_tracker tracker); #ifdef __cplusplus } #endif |