qt5base-lts/mkspecs/features
Thiago Macieira 96166fa56a Update the macros for shared/DLL and static builds
Up until now, we had a mess of different macros used for building
DLLs, for building shared libraries on Unix systems and for building
static libraries. Some of the macros were contradictory and did not
work. From now on, there shall be only:

 - QT_STATIC: indicates that it's a static Qt build and the export
   macros should expand to empty
 - QT_SHARED: indicates that it's a shared / dynamic Qt build and the
   export macros should expand to Q_DECL_EXPORT or Q_DECL_IMPORT,
   depending on whether the macro corresponds to the current module
   being built (the QT_BUILD_XXXX_LIB macro comes from the module's
   .pro file)

QT_BOOTSTRAPPED implies QT_STATIC since the bootstrapped tools link
statically to some source code.

QT_STATIC is recorded in qconfig.h by configure when Qt is configured
for static builds. Nothing is recorded for a shared / dynamic build,
so QT_SHARED is implied if nothing is defined. This allows for the
existence of a static_and_shared build: with nothing recorded,
defining QT_STATIC before qglobal.h causes the export macros to be
that of the static form. Linking to the static libraries is out of the
scope of this change (something for the buildsystem and linker to
figure out).

From this commit on, the proper way of declaring the export macros for
a module called QtFoo is:

    #ifndef QT_STATIC
    #  ifdef QT_BUILD_FOO_LIB
    #    define Q_FOO_EXPORT Q_DECL_EXPORT
    #  else
    #    define Q_FOO_EXPORT Q_DECL_IMPORT
    #  endif
    #else
    #  define Q_FOO_EXPORT
    #endif

The type of the Qt build is recorded in QT_CONFIG (in qconfig.pri) so
all Qt modules build by default the same type of library. The keywords
are "static" and "shared", used in both QT_CONFIG and CONFIG. The
previous keyword of "staticlib" is deprecated and should not be used.

Discussed-on: http://lists.qt-project.org/pipermail/development/2012-April/003172.html
Change-Id: I127896607794795b681c98d08467efd8af49bcf3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-28 06:21:48 +02:00
..
mac
qpa
unix
win32
build_pass.prf
c++11.prf
configure.prf
create_cmake.prf
ctest_testcase.prf
dbusadaptors.prf
dbusinterfaces.prf
debug_and_release.prf
debug.prf
declarative_debug.prf
default_post.prf Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
default_pre.prf
designer_defines.prf
device_config.prf
dll.prf
egl.prf
exceptions_off.prf
exceptions.prf
exclusive_builds.prf
include_source_dir.prf
incredibuild_xge.prf
lex.prf
link_pkgconfig.prf
moc.prf
module.prf
no_debug_info.prf
opengles1.prf
qml_debug.prf
qmltestcase.prf
qt_build_config.prf
qt_config.prf
qt_functions.prf
qt_installs.prf
qt_module_config.prf Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
qt_module_fwdpri.prf
qt_module_headers.prf
qt_module.prf
qt_plugin.prf Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
qt_targets.prf
qt.prf Update the macros for shared/DLL and static builds 2012-06-28 06:21:48 +02:00
quick1_debug.prf
release.prf
resolve_target.prf
resources.prf
shared.prf
silent.prf
static_and_shared.prf
static.prf
staticlib.prf
testcase.prf
testcocoon.prf
testlib_defines.prf
uic.prf
use_c_linker.prf
vxworks.prf
warn_off.prf
warn_on.prf
wayland-scanner.prf
yacc.prf