Fix armv7 embedded Linux build

In gui's CMakeLists.txt we have

    if (NOT ANDROID)
        ...
        add_qt_simd_part(Gui SIMD neon SOURCES ...)
        ...
    endif()

and later

    if(UNIX AND NOT ANDROID AND NOT APPLE_UIKIT AND NOT INTEGRITY AND NOT (TEST_architecture_arch STREQUAL "arm64"))
        add_qt_simd_part(Gui SIMD neon
    endif()

Since add_qt_simd_part internally uses an OBJECT library to compile the
sources with different flags and then link into Gui (in this case), we
may end up with an error when add_qt_simd_part is called twice for neon,
because the constructed target (Gui_simd_neon) exists already.

We can re-use an existing target though, as the SIMD features is the
same.

Change-Id: I7a21c6e66b47e918a53fa3b1a7db9e053ecc8d87
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Simon Hausmann 2019-11-11 13:38:13 +01:00
parent 8ef64341c3
commit 1b41a62893

View File

@ -2852,7 +2852,9 @@ function(add_qt_simd_part target)
endif() endif()
string(TOUPPER "QT_CFLAGS_${arg_SIMD}" simd_flags) string(TOUPPER "QT_CFLAGS_${arg_SIMD}" simd_flags)
add_library("${name}" OBJECT) if (NOT TARGET "${name}")
add_library("${name}" OBJECT)
endif()
target_sources("${name}" PRIVATE ${arg_SOURCES}) target_sources("${name}" PRIVATE ${arg_SOURCES})
target_include_directories("${name}" PRIVATE target_include_directories("${name}" PRIVATE
${arg_INCLUDE_DIRECTORIES} ${arg_INCLUDE_DIRECTORIES}