Prevent overly deep build dir hierarchy on Windows

On Windows, building Qt with Ninja Multi-Config failed in a reasonably
named build dir. The reason for that is our deep build dir hierarchy,
created with add_subdirectory, and long target names like
QNetworkListManagerNetworkInformationBackend within that hierarchy.

Rename said target to QNLMNIBackend, and set AUTOGEN_BUILD_DIR to a
short string that does not repeat the target name.

Fixes: QTBUG-94211
Change-Id: Iea6fee012fa46d9bfb01142b60e6cb5273893c50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d23613acf7bfe37c1c78eb9aadc489e888e34dfb)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Joerg Bornemann 2021-06-04 09:43:32 +02:00
parent 5c70015950
commit 557677186a

View File

@ -1,5 +1,5 @@
qt_internal_add_plugin(QNetworkListManagerNetworkInformationBackend
OUTPUT_NAME networklistmanagernetworkinformationbackend
qt_internal_add_plugin(QNLMNIPlugin
OUTPUT_NAME networklistmanager
CLASS_NAME QNetworkListManagerNetworkInformationBackendFactory
TYPE networkinformationbackends
DEFAULT_IF WINDOWS AND QT_FEATURE_networklistmanager
@ -7,3 +7,7 @@ qt_internal_add_plugin(QNetworkListManagerNetworkInformationBackend
PUBLIC_LIBRARIES
Qt::NetworkPrivate
)
# Don't repeat the target name in AUTOGEN_BUILD_DIR to work around issues with overlong paths.
set_property(TARGET QNLMNIPlugin PROPERTY
AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/autogen")