From 7b5fd05e8bdfe90af689541b0379289eb54b4079 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 30 Nov 2020 17:16:41 +0100 Subject: [PATCH] CMake: Allow WIN32 and MACOSX_BUNDLE arguments for qt6_add_executable qt6_add_executable will forward all arguments to add_executable, which works fine on Windows and macOS in regards of WIN32 and MACOSX_BUNDLE arguments. On Android however add_library is being used, and those arguments need to be removed otherwise they will be consided as source files. Pick-to: 6.0 Fixes: QTBUG-88926 Change-Id: Id22fdf91d58d9053eaad2d3c080ea72060d928c0 Reviewed-by: Craig Scott Reviewed-by: Alexandru Croitor --- src/corelib/Qt6CoreMacros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index f310f74584..bb1deffd04 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -430,6 +430,7 @@ set(_Qt6_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..") # Wrapper function that adds an executable with some Qt specific behavior. function(qt6_add_executable target) if(ANDROID) + list(REMOVE_ITEM ARGN "WIN32" "MACOSX_BUNDLE") add_library("${target}" MODULE ${ARGN}) # On our qmake builds we do don't compile the executables with # visibility=hidden. Not having this flag set will cause the