From 1b41a62893e33c1be8e1103da9eb201ce392be09 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Nov 2019 13:38:13 +0100 Subject: [PATCH] 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 --- cmake/QtBuild.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 5e2268254ee..31830b06b33 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2852,7 +2852,9 @@ function(add_qt_simd_part target) endif() 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_include_directories("${name}" PRIVATE ${arg_INCLUDE_DIRECTORIES}