Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.6.0, 6.7
-
None
-
fcb548878 (dev)
Description
We have a lot of tests defined in our configure.cmake files that aren't always applicable. For example:
qt_config_compile_test(integrityfb LABEL "INTEGRITY framebuffer" CODE "#include <device/fbdriver.h> int main(void) { /* BEGIN TEST: */ FBDriver *driver = 0; /* END TEST: */ return 0; } ") ... qt_feature("integrityfb" PRIVATE SECTION "Platform plugins" LABEL "INTEGRITY framebuffer" CONDITION INTEGRITY AND TEST_integrityfb )
The integrityfb test is conditional on INTEGRITY being true, which it will only be on Integrity systems. However, the test is compiled everywhere and contributes 360 ms of runtime for CMake.
We could reorganise the configure.cmake files with if for some conditions that will be set before the file is parsed (such as the OS, as in this case), but it won't work for feature-dependency tests, like:
qt_feature("poll_ppoll" PRIVATE LABEL "Native ppoll()" CONDITION NOT WASM AND TEST_ppoll EMIT_IF NOT WIN32 ) qt_feature("poll_pollts" PRIVATE LABEL "Native pollts()" CONDITION NOT QT_FEATURE_poll_ppoll AND TEST_pollts EMIT_IF NOT WIN32 ) qt_feature("poll_poll" PRIVATE LABEL "Native poll()" CONDITION NOT QT_FEATURE_poll_ppoll AND NOT QT_FEATURE_poll_pollts AND TEST_poll EMIT_IF NOT WIN32 )
The poll_pollts and poll_poll} tests don't need to be executed if {{poll_ppoll has already succeeded. And we can't use if here because the {[QT_FEATURE_}} variables won't be set yet.
I believe this is a regression from the qmake configure system.
Attachments
Issue Links
- relates to
-
QTBUG-107248 Investigate calling qt_find_package and qt_config_compile_test only for specific platforms based on feature conditions
- Reported
Gerrit Reviews
For Gerrit Dashboard: QTBUG-115705 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
493839,10 | CMake/Network: limit the testing for some network iface features | dev | qt/qtbase | Status: MERGED | -1 | 0 |