Commit 32f30329 authored by Ghislain MARY's avatar Ghislain MARY

Fix definition of BELR_PUBLIC for static build.

parent e9acc91a
...@@ -117,6 +117,16 @@ if(STRICT_OPTIONS_C) ...@@ -117,6 +117,16 @@ if(STRICT_OPTIONS_C)
list(REMOVE_DUPLICATES STRICT_OPTIONS_C) list(REMOVE_DUPLICATES STRICT_OPTIONS_C)
endif() endif()
set(BELR_CPPFLAGS ${BCTOOLBOX_CPPFLAGS})
if(ENABLE_STATIC)
list(APPEND BELR_CPPFLAGS "-DBELR_STATIC")
endif()
list(REMOVE_DUPLICATES BELR_CPPFLAGS)
if(BELR_CPPFLAGS)
add_definitions(${BELR_CPPFLAGS})
endif()
add_definitions("-DBELR_EXPORTS")
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
set(EXPORT_TARGETS_NAME "LinphoneBuilder") set(EXPORT_TARGETS_NAME "LinphoneBuilder")
else() else()
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
# BELR_FOUND - system has belr # BELR_FOUND - system has belr
# BELR_INCLUDE_DIRS - the belr include directory # BELR_INCLUDE_DIRS - the belr include directory
# BELR_LIBRARIES - The libraries needed to use belr # BELR_LIBRARIES - The libraries needed to use belr
# BELR_CPPFLAGS - The compilation flags needed to use belr
if(NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) if(NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${CMAKE_CURRENT_LIST_DIR}/BelrTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/BelrTargets.cmake")
...@@ -44,4 +45,5 @@ else() ...@@ -44,4 +45,5 @@ else()
set(BELR_LIBRARIES belr-static) set(BELR_LIBRARIES belr-static)
endif() endif()
set(BELR_CPPFLAGS @BELR_CPPFLAGS@)
set(BELR_FOUND 1) set(BELR_FOUND 1)
...@@ -8,10 +8,18 @@ ...@@ -8,10 +8,18 @@
using namespace ::std; using namespace ::std;
#if defined(_MSC_VER) #ifdef _MSC_VER
#define BELR_PUBLIC __declspec(dllexport) #ifdef BELR_STATIC
#define BELR_PUBLIC
#else
#ifdef BELR_EXPORTS
#define BELR_PUBLIC __declspec(dllexport)
#else
#define BELR_PUBLIC __declspec(dllimport)
#endif
#endif
#else #else
#define BELR_PUBLIC #define BELR_PUBLIC
#endif #endif
namespace belr{ namespace belr{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment