Details
Description
I've got a symbol conflict on linux with unity build enabled on conda-forge:
qnetworkinterface_linux.cpp:6, 2023-05-24T07:40:21.5559128Z from $SRC_DIR/build/qtbase/src/network/CMakeFiles/Network.dir/Unity/unity_1_cxx.cxx:65: 2023-05-24T07:40:21.5560110Z $BUILD_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/include/linux/if.h:71:46: error: 'IFF_UP' conflicts with a previous declaration 2023-05-24T07:40:21.5560463Z 71 | IFF_UP = 1<<0, /* sysfs */ 2023-05-24T07:40:21.5560693Z | ^ 2023-05-24T07:40:21.5560968Z In file included from $SRC_DIR/qtbase/src/network/socket/qnativesocketengine_unix.cpp:21, 2023-05-24T07:40:21.5561299Z from $SRC_DIR/build/qtbase/src/network/CMakeFiles/Network.dir/Unity/unity_1_cxx.cxx:63: 2023-05-24T07:40:21.5561763Z $BUILD_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/include/net/if.h:44:5: note: previous declaration '<unnamed enum> IFF_UP' 2023-05-24T07:40:21.5562074Z 44 | IFF_UP = 0x1, /* Interface is up. */
excluding qnativesocketengine_unix.cpp from unity build makes the erro go away:
diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index ec6e5f1426..c5636689b0 100644 --- a/qtbase/src/network/CMakeLists.txt +++ b/qtbase/src/network/CMakeLists.txt @@ -381,6 +381,8 @@ if (WIN32) PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) endif() +set_source_files_properties(socket/qnativesocketengine_unix.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + # include the snippet projects for developer-builds if(QT_FEATURE_private_tests) add_subdirectory(doc/snippets/network)
Attachments
For Gerrit Dashboard: QTBUG-113787 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
480151,2 | Network: Fix IFF_UP conflict on Linux with unity builds | dev | qt/qtbase | Status: MERGED | +2 | 0 |
480259,2 | Network: Fix IFF_UP conflict on Linux with unity builds | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |