File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1818* this header. Under Visual Studio the library is linked in automatically.
1919*/
2020
21- #ifdef _WIN32
22- #ifdef LIBLSL_EXPORTS
21+ #ifdef __MINGW32__
22+ #ifdef LIBLSL_STATIC
23+ #define LIBLSL_C_API
24+ #elif defined (LIBLSL_EXPORTS )
25+ #define LIBLSL_C_API __declspec(dllexport)
26+ #else
27+ #define LIBLSL_C_API __declspec(dllimport)
28+ #endif
29+ #elif defined (_WIN32 )
30+ #ifdef LIBLSL_STATIC
31+ #define LIBLSL_C_API
32+ #elif defined (LIBLSL_EXPORTS )
2333 #define LIBLSL_C_API __declspec(dllexport)
2434 #else
2535 #ifndef _DEBUG
Original file line number Diff line number Diff line change @@ -33,11 +33,15 @@ message (${Boost_LIBRARIES})
3333
3434if (BUILD_SHARED)
3535 add_library (lsl SHARED ${sources} )
36-
36+
3737 # TODO: Need to check if all flags are necessary or if some flags are missing
3838 if (WIN32 )
3939 set_property (TARGET lsl PROPERTY COMPILE_DEFINITIONS BOOST_ALL_NO_LIB BOOST_THREAD_BUILD_LIB LIBLSL_EXPORTS _SCL_SECURE_NO_WARNINGS _CRT_SECURE_NO_WARNINGS)
40- target_link_libraries (lsl ${Boost_LIBRARIES} )
40+ if (MINGW)
41+ target_link_libraries (lsl ${Boost_LIBRARIES} winmm ws2_32 wsock32)
42+ else ()
43+ target_link_libraries (lsl ${Boost_LIBRARIES} )
44+ endif ()
4145 elseif (APPLE )
4246 target_link_libraries (lsl ${Boost_LIBRARIES} pthread)
4347 elseif (UNIX )
@@ -59,7 +63,8 @@ endif (BUILD_SHARED)
5963
6064if (BUILD_STATIC)
6165 add_library (lsl-static STATIC ${sources} )
62-
66+ set_property (TARGET lsl-static PROPERTY COMPILE_DEFINITIONS LIBLSL_STATIC)
67+
6368 # TODO: Need to check if all flags are necessary or if some flags are missing
6469 # TODO: Add support for other platforms
6570 if (UNIX )
You can’t perform that action at this time.
0 commit comments