[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [dferry] /: CMake already defines export support macros - use them.
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2016-10-12 0:57:07
Message-ID: E1bu7r1-0007PZ-Pf () code ! kde ! org
[Download RAW message or body]

Git commit 774169d38321bfb9ecd8a77f3af64dacad287fdd by Andreas Hartmetz.
Committed on 09/10/2016 at 20:36.
Pushed by ahartmetz into branch 'master'.

CMake already defines export support macros - use them.

M  +0    -2    CMakeLists.txt
M  +5    -5    util/export.h

http://commits.kde.org/dferry/774169d38321bfb9ecd8a77f3af64dacad287fdd

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 599d2d3..3f65cf4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,7 +123,6 @@ set(DFER_HEADERS ${DFER_PUBLIC_HEADERS} ${DFER_PRIVATE_=
HEADERS})
 =

 add_library(dfer SHARED ${DFER_SOURCES} ${DFER_HEADERS})
 target_include_directories(dfer INTERFACE "$<INSTALL_INTERFACE:include/dfe=
rry>")
-target_compile_definitions(dfer PRIVATE -DBUILDING_LIBDFER)
 if (WIN32)
     target_link_libraries(dfer PRIVATE ws2_32)
 endif()
@@ -145,7 +144,6 @@ set(DFERCLIENT_HEADERS
 =

 add_library(dferclient SHARED ${DFERCLIENT_SOURCES} ${DFERCLIENT_HEADERS})
 target_include_directories(dferclient INTERFACE "$<INSTALL_INTERFACE:inclu=
de/dferry>")
-target_compile_definitions(dferclient PRIVATE -DBUILDING_LIBDFERCLIENT)
 target_link_libraries(dferclient PUBLIC dfer PRIVATE ${LIBTINYXML2_LIBRARI=
ES})
 =

 install(TARGETS dfer dferclient EXPORT dferryExports DESTINATION ${CMAKE_I=
NSTALL_LIBDIR})
diff --git a/util/export.h b/util/export.h
index 2f418c9..6a82c5a 100644
--- a/util/export.h
+++ b/util/export.h
@@ -23,13 +23,13 @@
 =

 #ifdef _WIN32
 =

-#ifdef BUILDING_LIBDFER
+#ifdef dfer_EXPORTS
 #define DFERRY_EXPORT __declspec(dllexport)
 #else
 #define DFERRY_EXPORT __declspec(dllimport)
 #endif
 =

-#ifdef BUILDING_LIBDFERCLIENT
+#ifdef dferclient_EXPORTS
 #define DFERRYCLIENT_EXPORT __declspec(dllexport)
 #else
 #define DFERRYCLIENT_EXPORT __declspec(dllimport)
@@ -37,16 +37,16 @@
 =

 #else
 =

-#ifdef BUILDING_LIBDFER
+#ifdef dfer_EXPORTS
 #define DFERRY_EXPORT __attribute__ ((visibility ("protected")))
 #else
 #define DFERRY_EXPORT __attribute__ ((visibility ("default")))
 #endif
 =

-#ifdef BUILDING_LIBDFERCLIENT
+#ifdef dferclient_EXPORTS
 #define DFERRYCLIENT_EXPORT __attribute__ ((visibility ("protected")))
 #else
 #define DFERRYCLIENT_EXPORT __attribute__ ((visibility ("default")))
 #endif
 =

-#endif // _WIN32
\ No newline at end of file
+#endif // _WIN32

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic