diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index 32e00d030b2..32081eb1f62 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -494,7 +494,15 @@ function(qt_internal_setup_cmake_config_postfix) set(default_cmake_debug_postfix "d") endif() elseif(APPLE) - set(default_cmake_debug_postfix "_debug") + # Only add a suffix for explicit no-framework builds. + # For framework builds the library inside the framework + # is always unsuffixed, and we want to match that for + # plugins and other non-framework (static) libraries. + if(NOT (QT_FEATURE_framework OR FEATURE_framework + # Account for default in configure.json being ON + OR (NOT DEFINED QT_FEATURE_framework AND NOT DEFINED FEATURE_framework))) + set(default_cmake_debug_postfix "_debug") + endif() endif() set(custom_postfix_vars "") diff --git a/configure.cmake b/configure.cmake index 411a6f9f39e..db358bb7048 100644 --- a/configure.cmake +++ b/configure.cmake @@ -643,6 +643,8 @@ qt_feature("force_asserts" PUBLIC qt_feature("framework" PUBLIC LABEL "Build Apple Frameworks" AUTODETECT ON + # If changing this, please align with logic in + # qt_internal_setup_cmake_config_postfix. CONDITION APPLE ) qt_feature_definition("framework" "QT_MAC_FRAMEWORK_BUILD") diff --git a/tests/auto/corelib/plugin/qpluginloader/tst/CMakeLists.txt b/tests/auto/corelib/plugin/qpluginloader/tst/CMakeLists.txt index 16dd1cf9cfa..30931b4b28e 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst/CMakeLists.txt +++ b/tests/auto/corelib/plugin/qpluginloader/tst/CMakeLists.txt @@ -50,7 +50,7 @@ endif() ## Scopes: ##################################################################### -qt_internal_extend_target(tst_qpluginloader CONDITION QT_FEATURE_private_tests +qt_internal_extend_target(tst_qpluginloader LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp index f4ecf5bfb35..4ff93f9de49 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp @@ -12,6 +12,8 @@ #include #include "theplugin/plugininterface.h" +#include + #if defined(QT_BUILD_INTERNAL) && defined(Q_OF_MACH_O) # include #endif @@ -33,10 +35,10 @@ using namespace Qt::StringLiterals; # define bundle_VALID true # define dylib_VALID true # define so_VALID true -# ifdef QT_NO_DEBUG -# define SUFFIX ".dylib" -# else +# if QT_CONFIG(debug) && !QT_CONFIG(framework) # define SUFFIX "_debug.dylib" +# else +# define SUFFIX ".dylib" # endif # define PREFIX "lib"