Browse Source

Qtfy shared exports

Alexey Edelev 5 years ago
parent
commit
d66dcb7726

+ 2 - 2
src/grpc/CMakeLists.txt

@@ -25,10 +25,10 @@ file(GLOB HEADERS asyncreply.h
     abstractcredentials.h
     sslcredentials.h
     insecurecredentials.h
-    qtgrpc_global.h)
+    qtgrpcglobal.h)
 
 add_library(${TARGET} SHARED ${SOURCES})
-target_compile_definitions(${TARGET} PRIVATE QTGRPC_LIB)
+target_compile_definitions(${TARGET} PRIVATE QT_BUILD_GRPC_LIB)
 
 add_library(${QTPROTOBUF_COMMON_NAMESPACE}::${TARGET} ALIAS ${TARGET})
 set_target_properties(${TARGET} PROPERTIES VERSION ${PROJECT_VERSION} PUBLIC_HEADER "${HEADERS}" OUTPUT_NAME ${TARGET})

+ 2 - 2
src/grpc/abstractchannel.h

@@ -29,7 +29,7 @@
 #include <QByteArray>
 #include <functional>
 
-#include "qtgrpc_global.h"
+#include "qtgrpcglobal.h"
 
 namespace qtprotobuf {
 
@@ -39,7 +39,7 @@ class AbstractClient;
  * \ingroup QtGrpc
  * \brief The AbstractChannel class
  */
-class QTGRPCSHARED_EXPORT AbstractChannel
+class Q_GRPC_EXPORT AbstractChannel
 {
 public:
     /*!

+ 2 - 2
src/grpc/abstractclient.h

@@ -37,7 +37,7 @@
 #include "abstractchannel.h"
 #include "asyncreply.h"
 
-#include "qtgrpc_global.h"
+#include "qtgrpcglobal.h"
 
 namespace qtprotobuf {
 class AbstractChannel;
@@ -46,7 +46,7 @@ class AbstractChannel;
  * \ingroup QtGrpc
  * \brief The AbstractClient class
  */
-class QTGRPCSHARED_EXPORT AbstractClient : public QObject
+class Q_GRPC_EXPORT AbstractClient : public QObject
 {
     Q_OBJECT
 public:

+ 4 - 4
src/grpc/abstractcredentials.h

@@ -31,7 +31,7 @@
 
 #include <functional>
 
-#include "qtgrpc_global.h"
+#include "qtgrpcglobal.h"
 
 namespace qtprotobuf {
 /*!
@@ -45,7 +45,7 @@ class ChannelCredentials;
 /*!
  * \brief The AbstractCredentials class
  */
-class QTGRPCSHARED_EXPORT AbstractCredentials
+class Q_GRPC_EXPORT AbstractCredentials
 {
 public:
     template<typename Call, typename Channel,
@@ -83,7 +83,7 @@ private:
 /*!
  * \brief The CallCredentials class
  */
-class QTGRPCSHARED_EXPORT CallCredentials : public AbstractCredentials
+class Q_GRPC_EXPORT CallCredentials : public AbstractCredentials
 {
 protected:
     CallCredentials(const CredentialMap &credentialMap) {
@@ -98,7 +98,7 @@ private:
 /*!
  * \brief The ChannelCredentials class
  */
-class QTGRPCSHARED_EXPORT ChannelCredentials : public AbstractCredentials
+class Q_GRPC_EXPORT ChannelCredentials : public AbstractCredentials
 {
 protected:
     ChannelCredentials(const CredentialMap &credentialMap) {

+ 2 - 2
src/grpc/asyncreply.h

@@ -32,14 +32,14 @@
 
 #include "abstractchannel.h"
 
-#include "qtgrpc_global.h"
+#include "qtgrpcglobal.h"
 
 namespace qtprotobuf {
 /*!
  * \ingroup QtGrpc
  * \brief The AsyncReply class
  */
-class QTGRPCSHARED_EXPORT AsyncReply final : public QObject
+class Q_GRPC_EXPORT AsyncReply final : public QObject
 {
     Q_OBJECT
 public:

+ 1 - 1
src/grpc/http2channel.h

@@ -37,7 +37,7 @@ class AbstractCredentials;
  * \ingroup QtGrpc
  * \brief The Http2Channel class
  */
-class QTGRPCSHARED_EXPORT Http2Channel final : public AbstractChannel
+class Q_GRPC_EXPORT Http2Channel final : public AbstractChannel
 {
 public:
     [[deprecated ("This contructor is obsolete and is going to be removed soon. Use Http2Channel(const QUrl&, const AbstractCredentials&)")]]

+ 2 - 2
src/grpc/insecurecredentials.h

@@ -27,14 +27,14 @@
 
 #include "abstractcredentials.h"
 
-#include "qtgrpc_global.h"
+#include "qtgrpcglobal.h"
 
 namespace qtprotobuf {
 /*!
  * \ingroup QtGrpc
  * \brief The InsecureCredentials class
  */
-class QTGRPCSHARED_EXPORT InsecureCredentials : public ChannelCredentials
+class Q_GRPC_EXPORT InsecureCredentials : public ChannelCredentials
 {
 public:
     InsecureCredentials() : ChannelCredentials(CredentialMap()) {}

+ 3 - 3
src/grpc/qtgrpc_global.h → src/grpc/qtgrpcglobal.h

@@ -27,8 +27,8 @@
 
 #include <QtCore/QtGlobal>
 
-#ifdef QTGRPC_LIB
-    #define QTGRPCSHARED_EXPORT Q_DECL_EXPORT
+#ifdef QT_BUILD_GRPC_LIB
+    #define Q_GRPC_EXPORT Q_DECL_EXPORT
 #else
-    #define QTGRPCSHARED_EXPORT Q_DECL_IMPORT
+    #define Q_GRPC_EXPORT Q_DECL_IMPORT
 #endif

+ 2 - 2
src/grpc/sslcredentials.h

@@ -29,14 +29,14 @@
 
 #include <QSslConfiguration>
 
-#include "qtgrpc_global.h"
+#include "qtgrpcglobal.h"
 
 namespace qtprotobuf {
 /*!
  * \ingroup QtGrpc
  * \brief The SslCredentials class
  */
-class QTGRPCSHARED_EXPORT SslCredentials : public ChannelCredentials
+class Q_GRPC_EXPORT SslCredentials : public ChannelCredentials
 {
 public:
     SslCredentials(const QSslConfiguration &configuation) :

+ 2 - 2
src/protobuf/CMakeLists.txt

@@ -20,7 +20,7 @@ file(GLOB SOURCES
     qprotobufserializer.cpp)
 
 file(GLOB HEADERS
-    qtprotobuf_global.h
+    qtprotobufglobal.h
     qtprotobuftypes.h
     qtprotobuflogging.h
     qprotobufobject.h
@@ -31,7 +31,7 @@ file(GLOB HEADERS
     qprotobufregistrationhelper.h)
 
 add_library(${TARGET} SHARED ${SOURCES})
-target_compile_definitions(${TARGET} PRIVATE QTPROTOBUF_LIB)
+target_compile_definitions(${TARGET} PRIVATE QT_BUILD_PROTOBUF_LIB)
 
 add_library(${QTPROTOBUF_COMMON_NAMESPACE}::${TARGET} ALIAS ${TARGET})
 set_target_properties(${TARGET} PROPERTIES VERSION ${PROJECT_VERSION} PUBLIC_HEADER "${HEADERS}" OUTPUT_NAME ${TARGET})

+ 3 - 3
src/protobuf/qabstractprotobufserializer.h

@@ -36,7 +36,7 @@
 #include "qtprotobuflogging.h"
 #include "qprotobufselfcheckiterator.h"
 
-#include "qtprotobuf_global.h"
+#include "qtprotobufglobal.h"
 
 namespace qtprotobuf {
 /*!
@@ -50,7 +50,7 @@ namespace qtprotobuf {
  * \details This class is used by QProtobufSerializerRegistry to access basic serialization routines.
  *
  */
-class QTPROTOBUFSHARED_EXPORT QAbstractProtobufSerializer
+class Q_PROTOBUF_EXPORT QAbstractProtobufSerializer
 {
 public:
     /*!
@@ -100,7 +100,7 @@ protected:
 /*!
  * \brief The QProtobufSerializer class
  */
-class QTPROTOBUFSHARED_EXPORT QProtobufSerializer : public QAbstractProtobufSerializer
+class Q_PROTOBUF_EXPORT QProtobufSerializer : public QAbstractProtobufSerializer
 {
 public:
     QProtobufSerializer();

+ 2 - 2
src/protobuf/qprotobufselfcheckiterator.h

@@ -26,7 +26,7 @@
 #include <QByteArray>
 #include <stdexcept>
 
-#include "qtprotobuf_global.h"
+#include "qtprotobufglobal.h"
 
 #pragma once
 
@@ -36,7 +36,7 @@ namespace qtprotobuf {
  * \ingroup QtProtobuf
  * \brief The QProtobufSelfcheckIterator class
  */
-class QTPROTOBUFSHARED_EXPORT QProtobufSelfcheckIterator
+class Q_PROTOBUF_EXPORT QProtobufSelfcheckIterator
 {
 public:
     QProtobufSelfcheckIterator(const QByteArray &container) : m_sizeLeft(container.size())

+ 2 - 2
src/protobuf/qprotobufserializerregistry.h

@@ -35,7 +35,7 @@
 #include "qprotobufselfcheckiterator.h"
 #include "qabstractprotobufserializer.h"
 
-#include "qtprotobuf_global.h"
+#include "qtprotobufglobal.h"
 
 namespace qtprotobuf {
 /*!
@@ -57,7 +57,7 @@ namespace qtprotobuf {
  *          Practically code above is generated automaticaly by running qtprotobufgenerator or using cmake build macro
  *          generate_qtprotobuf, based on .proto files. But it's still possible to reuse manually written code if needed.
  */
-class QTPROTOBUFSHARED_EXPORT QProtobufSerializerRegistry
+class Q_PROTOBUF_EXPORT QProtobufSerializerRegistry
 {
     QProtobufSerializerRegistry() = delete;
     ~QProtobufSerializerRegistry() = delete;

+ 3 - 3
src/protobuf/qtprotobuf_global.h → src/protobuf/qtprotobufglobal.h

@@ -27,8 +27,8 @@
 
 #include <QtCore/QtGlobal>
 
-#ifdef QTPROTOBUF_LIB
-    #define QTPROTOBUFSHARED_EXPORT Q_DECL_EXPORT
+#if defined(QT_BUILD_PROTOBUF_LIB)
+#  define Q_PROTOBUF_EXPORT Q_DECL_EXPORT
 #else
-    #define QTPROTOBUFSHARED_EXPORT Q_DECL_IMPORT
+#  define Q_PROTOBUF_EXPORT Q_DECL_IMPORT
 #endif

+ 2 - 2
src/protobuf/qtprotobuflogging.h

@@ -25,9 +25,9 @@
 
 #pragma once
 #include <QLoggingCategory>
-#include <qtprotobuf_global.h>
+#include <qtprotobufglobal.h>
 
-QTPROTOBUFSHARED_EXPORT Q_DECLARE_LOGGING_CATEGORY(qtprotobuflog)
+Q_PROTOBUF_EXPORT Q_DECLARE_LOGGING_CATEGORY(qtprotobuflog)
 
 #define qProtoDebug(...) qCDebug(qtprotobuflog, __VA_ARGS__)
 #define qProtoInfo(...) qCInfo(qtprotobuflog, __VA_ARGS__)