diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-08-24 16:45:07 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-08-25 09:25:33 +0000 |
commit | 38944be4048e19a0ab6f3b8961f58e36048b53a8 (patch) | |
tree | b32af412fa63ed766b31809d873ee06981257436 /src/core/core_gyp_generator.pro | |
parent | 8ddc67c49f33efdef6b1418aa9090a5d784e1ed4 (diff) |
MSVC: force export of API symbols
The public API symbols are compiled in a static library that's linked to core
with --whole-archive when using gcc. As there's no equivalent for this in MSVC
we create a dummy C++ source file that includes every API header file to make
sure that every __declspec(dllexport) is honored.
Change-Id: If0dafedceb52046aecde60b2a2a624df8ab219b4
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/core_gyp_generator.pro')
-rw-r--r-- | src/core/core_gyp_generator.pro | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index f2834946f..247ec482a 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -175,3 +175,18 @@ qtHaveModule(positioning) { HEADERS += location_provider_qt.h DEFINES += QT_USE_POSITIONING=1 } + +win32:msvc { + EXPORTS_CPP = $$OUT_PWD/api/public_exports.cpp + !build_pass { + API_HEADERS = $$files($$PWD/api/*.h) + CONTENT = "// Dummy C++ file to make sure API symbols are exported." + for(f, API_HEADERS) { + CONTENT += "$${LITERAL_HASH}include <$$basename(f)>" + } + write_file($$EXPORTS_CPP, CONTENT) + unset(API_HEADERS) + unset(CONTENT) + } + SOURCES += $$EXPORTS_CPP +} |