summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/api/core_api.pro8
-rw-r--r--src/core/core_gyp_generator.pro15
-rw-r--r--src/core/core_module.pro7
3 files changed, 13 insertions, 17 deletions
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
index 63b657ecb..6a37b2ac3 100644
--- a/src/core/api/core_api.pro
+++ b/src/core/api/core_api.pro
@@ -47,3 +47,11 @@ SOURCES = \
qwebengineurlrequestinfo.cpp \
qwebengineurlrequestjob.cpp \
qwebengineurlschemehandler.cpp
+
+msvc {
+ # Create a list of object files that can be used as response file for the linker.
+ # This is done to simulate -whole-archive on MSVC.
+ QMAKE_POST_LINK = \
+ "if exist $(DESTDIR_TARGET).objects del $(DESTDIR_TARGET).objects$$escape_expand(\\n\\t)" \
+ "for %%a in ($(OBJECTS)) do echo $$shell_quote($$shell_path($$OUT_PWD))\\%%a >> $(DESTDIR_TARGET).objects"
+}
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro
index 17d73ccfd..c1b8179e0 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_gyp_generator.pro
@@ -178,18 +178,3 @@ 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
-}
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 219df8e34..cf253a735 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -19,8 +19,11 @@ LIBS_PRIVATE += -L$$api_library_path
CONFIG *= no_smart_library_merge
osx {
LIBS_PRIVATE += -Wl,-force_load,$${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
-} else:win32-msvc* {
- LIBS_PRIVATE += /OPT:REF -l$$api_library_name
+} else:msvc {
+ # Simulate -whole-archive by passing the list of object files that belong to the public
+ # API library as response file to the linker.
+ LIBS_PRIVATE += /OPT:REF
+ QMAKE_LFLAGS += @$${api_library_path}$${QMAKE_DIR_SEP}$${api_library_name}.lib.objects
} else {
LIBS_PRIVATE += -Wl,-whole-archive -l$$api_library_name -Wl,-no-whole-archive
}