Skip to content

Commit

Permalink
fixup! Test shared library on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielius1922 committed Feb 14, 2022
1 parent 2613791 commit 4bea4ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ add_library(uuid-shared SHARED ${UUID_SRC})
set_property(TARGET uuid-shared PROPERTY C_VISIBILITY_PRESET hidden)
set_property(TARGET uuid-shared PROPERTY VISIBILITY_INLINES_HIDDEN ON)
target_compile_definitions(uuid-shared PUBLIC OC_SHARED_LIBRARY)
set_target_properties(uuid-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORTS")
set_target_properties(uuid-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORT")
target_include_directories(uuid-shared PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
Expand Down Expand Up @@ -453,7 +453,7 @@ endif()
set_property(TARGET client-python-shared PROPERTY C_VISIBILITY_PRESET hidden)
set_property(TARGET client-python-shared PROPERTY VISIBILITY_INLINES_HIDDEN ON)
target_compile_definitions(client-python-shared PUBLIC OC_SHARED_LIBRARY)
set_target_properties(client-python-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORTS")
set_target_properties(client-python-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORT")
set_target_properties(client-python-shared PROPERTIES
OUTPUT_NAME "iotivity-lite-client-python"
VERSION ${PROJECT_VERSION}
Expand Down
14 changes: 7 additions & 7 deletions include/oc_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@
#ifndef OC_EXPORT_H
#define OC_EXPORT_H

#if defined _WIN32 || defined __CYGWIN__ || defined __MINGW32__
#ifdef _WIN32
#define OC_EXPORT __declspec(dllexport)
#define OC_IMPORT __declspec(dllimport)
#elif __GNUC__ >= 4
#elif (defined __GNUC__ && __GNUC__ >= 4)
#define OC_EXPORT __attribute__((visibility("default")))
#define OC_IMPORT
#else /* __GNUC__ < 4 */
#else /* !__GNUC__ || __GNUC__ < 4 */
#warning "Shared libraries not supported"
#define OC_EXPORT
#define OC_IMPORT
#endif /* defined _WIN32 || defined __CYGWIN__ || defined __MINGW32__ */
#endif /* _WIN32 */

#ifdef OC_SHARED_LIBRARY
#ifdef OC_SHARED_LIBRARY_EXPORTS
#ifdef OC_SHARED_LIBRARY_EXPORT
#define OC_API OC_EXPORT
#else /* !OC_SHARED_LIBRARY_EXPORTS*/
#else /* !OC_SHARED_LIBRARY_EXPORT*/
#define OC_API OC_IMPORT
#endif /* OC_SHARED_LIBRARY_EXPORTS */
#endif /* OC_SHARED_LIBRARY_EXPORT */
#else /* !OC_SHARED_LIBRARY */
#define OC_API
#endif /* OC_SHARED_LIBRARY */
Expand Down

0 comments on commit 4bea4ae

Please sign in to comment.