QtNetwork/Windows: Add exclusions for CMake Unity (Jumbo) builds

The "interface" define in windows.h causes clashes with
variables named "interface". It cannot be undef'ed
since the winsock headers also uses it.

Task-number: QTBUG-109394
Change-Id: Id2daedfd6c57aae39a1fdfe92482f17884b68ef5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0fc1f8174f3a899d3c3ee969596a0ad260a7bb8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Friedemann Kleint 2023-01-27 19:20:14 +01:00 committed by Qt Cherry-pick Bot
parent d0f13e420e
commit 5083ab72c7

View File

@ -367,6 +367,25 @@ qt_internal_extend_target(Network CONDITION QNX PUBLIC_LIBRARIES socket) # speci
qt_internal_extend_target(Network CONDITION SOLARIS PUBLIC_LIBRARIES socket nsl) # special case
if (WIN32)
set_source_files_properties(Network # include windows.h (causing clashes with "interface" define)
kernel/qauthenticator.cpp
kernel/qdnslookup_win.cpp
kernel/qhostaddress.cpp
kernel/qhostinfo.cpp
kernel/qhostinfo_win.cpp
kernel/qnetconmonitor_win.cpp
kernel/qnetworkinterface_win.cpp
kernel/qnetworkproxy_win.cpp
socket/qabstractsocket.cpp
socket/qlocalserver.cpp
socket/qlocalserver_win.cpp
socket/qlocalsocket_win.cpp
socket/qnativesocketengine.cpp
socket/qnativesocketengine_win.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
endif()
# include the snippet projects for developer-builds
if(QT_FEATURE_private_tests)
add_subdirectory(doc/snippets/network)