From 17cb2cde9c6a3377f948552c3c37d2eb3b813439 2016-05-19 18:49:57 From: Oswald Buddenhagen Date: 2016-05-19 18:49:57 Subject: [PATCH] use standardized module export macros Change-Id: I11212f72fec22ed73712267d8ff03b0475ecd56b Reviewed-by: Miikka Heikkinen Reviewed-by: Tomi Korpipää --- diff --git a/src/charts/charts.pro b/src/charts/charts.pro index 9b6c7fe..d5e9160 100644 --- a/src/charts/charts.pro +++ b/src/charts/charts.pro @@ -3,9 +3,6 @@ TARGET = QtCharts QT = core gui widgets -DEFINES += QT_CHARTS_LIBRARY -# Fix exports in static builds for applications linking charts module -static: MODULE_DEFINES += QT_CHARTS_STATICLIB QMAKE_DOCS = $$PWD/doc/qtcharts.qdocconf diff --git a/src/charts/qchartglobal.h b/src/charts/qchartglobal.h index 2f6e35a..81a7f55 100644 --- a/src/charts/qchartglobal.h +++ b/src/charts/qchartglobal.h @@ -34,26 +34,24 @@ */ #define QT_CHARTS_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) -#if defined(QT_CHARTS_LIBRARY) -# define QT_CHARTS_EXPORT Q_DECL_EXPORT +#ifndef QT_STATIC +# if defined(QT_BUILD_CHARTS_LIB) +# define QT_CHARTS_EXPORT Q_DECL_EXPORT +# else +# define QT_CHARTS_EXPORT Q_DECL_IMPORT +# endif #else -# define QT_CHARTS_EXPORT Q_DECL_IMPORT +# define QT_CHARTS_EXPORT #endif -#if defined(BUILD_PRIVATE_UNIT_TESTS) && defined(QT_CHARTS_LIBRARY) +#if defined(BUILD_PRIVATE_UNIT_TESTS) && defined(QT_BUILD_CHARTS_LIB) # define QT_CHARTS_AUTOTEST_EXPORT Q_DECL_EXPORT -#elif defined(BUILD_PRIVATE_UNIT_TESTS) && !defined(QT_CHARTS_LIBRARY) +#elif defined(BUILD_PRIVATE_UNIT_TESTS) && !defined(QT_BUILD_CHARTS_LIB) # define QT_CHARTS_AUTOTEST_EXPORT Q_DECL_IMPORT #else # define QT_CHARTS_AUTOTEST_EXPORT #endif -#ifdef QT_CHARTS_STATICLIB -# undef QT_CHARTS_EXPORT -# undef QT_CHARTS_AUTOTEST_EXPORT -# define QT_CHARTS_EXPORT -# define QT_CHARTS_AUTOTEST_EXPORT -#endif #define QT_CHARTS_NAMESPACE QtCharts