summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-11-11 13:38:13 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2019-11-11 13:04:12 +0000
commit1b41a62893e33c1be8e1103da9eb201ce392be09 (patch)
tree57c8842836d5ad079a0fdac414d0eadd791ef0db /cmake/QtBuild.cmake
parent8ef64341c3227937617f78bc3fe3f6a13e78df0d (diff)
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>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 5e2268254e..31830b06b3 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}