Skip to content

Commit

Permalink
Support for static building into Windows. Fix visibility for that
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rivero committed Oct 11, 2017
1 parent 3fb1525 commit e509a3d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
25 changes: 15 additions & 10 deletions include/fcl/common/visibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,25 @@
*/

#if defined _WIN32 || defined __CYGWIN__
#ifdef BUILDING_DLL
#ifdef __GNUC__
#define FCL_VISIBLE __attribute__ ((dllexport))
#else
#define FCL_VISIBLE __declspec(dllexport)
#endif
#ifdef FCL_STATIC_LIBRARY
#define FCL_VISIBLE
#define FCL_HIDDEN
#else
#ifdef __GNUC__
#define FCL_VISIBLE __attribute__ ((dllimport))
#ifdef FCL_EXPORTS
#ifdef __GNUC__
#define FCL_VISIBLE __attribute__ ((dllexport))
#else
#define FCL_VISIBLE __declspec(dllexport)
#endif
#else
#define FCL_VISIBLE __declspec(dllimport)
#ifdef __GNUC__
#define FCL_VISIBLE __attribute__ ((dllimport))
#else
#define FCL_VISIBLE __declspec(dllimport)
#endif
#endif
#define FCL_HIDDEN
#endif
#define FCL_HIDDEN
#else
#ifdef FCL_HIDE_ALL_SYMBOLS
#define FCL_VISIBLE __attribute__ ((visibility ("hidden")))
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ if(FCL_STATIC_LIBRARY)
add_library(${PROJECT_NAME} STATIC ${FCL_HEADERS} ${FCL_SOURCE_CODE})
else()
add_library(${PROJECT_NAME} SHARED ${FCL_HEADERS} ${FCL_SOURCE_CODE})
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_DEFINITIONS FCL_EXPORTS
DEFINE_SYMBOL FCL_EXPORTS)
endif()

# Be sure to pass to the consumer the set of SIMD used in the compilation
Expand Down

0 comments on commit e509a3d

Please sign in to comment.