diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2023-08-08 18:30:57 +0000 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2023-08-09 00:34:15 +0000 |
commit | bc88bb34caf1185a25eda77ee022843c0ca988b0 (patch) | |
tree | 36530ad5ab2f93f49f792a715cc307f96b8a4d9a /tests/auto/cmake | |
parent | bb11f7a9fa576b679fc64b09abadebf90dfbe9a1 (diff) |
Revert "CMake: Place resources into static libraries, not object libraries"
This reverts commit ce8874fc3b0bab2066080315c8774b30c038862c.
Reason for revert: Doesn't handle resource names that are invalid identifiers
Change-Id: Idf24bd9797284ce9de382a8e233d56c799a09099
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/cmake')
5 files changed, 0 insertions, 67 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 1ce6f8a020..975cc6fc7d 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -222,7 +222,6 @@ _qt_internal_test_expect_pass(test_multiple_find_package) _qt_internal_test_expect_pass(test_add_resources_delayed_file) _qt_internal_test_expect_pass(test_add_binary_resources_delayed_file BINARY test_add_binary_resources_delayed_file) _qt_internal_test_expect_pass(test_qt_add_resources_rebuild) -_qt_internal_test_expect_pass(test_resource_without_obj_lib BINARY test_resource_without_obj_lib) if(NOT NO_GUI) _qt_internal_test_expect_pass(test_private_includes) diff --git a/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt b/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt deleted file mode 100644 index 16563141f4..0000000000 --- a/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2023 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.16) - -project(test_resource_without_obj_lib) - -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake") -endif() - -find_package(Qt6 REQUIRED - COMPONENTS Core Test - HINTS ${Qt6Tests_PREFIX_PATH} -) - -qt6_add_library(helper_lib STATIC helper_lib.cpp) -qt6_add_resources(helper_lib "helper_res" FILES resource.txt PREFIX "/") - -# Link to Core, to ensure both the helper_lib and the main executable -# inherit the QT_NAMESPACE if it is set, otherwise we get undefined -# linker errors due to the mismatch in symbol names. -target_link_libraries(helper_lib PRIVATE Qt6::Core) - -set(CMAKE_AUTOMOC ON) - -qt6_add_executable(test_resource_without_obj_lib main.cpp) -target_link_libraries(test_resource_without_obj_lib PRIVATE Qt6::Core Qt6::Test) - -# Link against the library file and not the target, so that we can confirm -# the ability to manually initialize the resource via Q_INIT_RESOURCE. -target_link_libraries(test_resource_without_obj_lib PRIVATE $<TARGET_FILE:helper_lib>) - diff --git a/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp b/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp deleted file mode 100644 index 18371786a9..0000000000 --- a/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -void nothing() {} diff --git a/tests/auto/cmake/test_resource_without_obj_lib/main.cpp b/tests/auto/cmake/test_resource_without_obj_lib/main.cpp deleted file mode 100644 index 29ea0f7272..0000000000 --- a/tests/auto/cmake/test_resource_without_obj_lib/main.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include <QtCore/qtresource.h> -#include <QtTest/QtTest> - -class TestManualResourceInit : public QObject -{ - Q_OBJECT -private slots: - void initTestCase(); - void resourceExistsAfterManualInit(); -}; - -void TestManualResourceInit::initTestCase() -{ - // Manually initialize the resource like we used to do it in qt5 + qmake times. - Q_INIT_RESOURCE(helper_res); -} - -void TestManualResourceInit::resourceExistsAfterManualInit() -{ - QVERIFY(QFile::exists(":/resource.txt")); -} - -QTEST_MAIN(TestManualResourceInit) -#include "main.moc" - diff --git a/tests/auto/cmake/test_resource_without_obj_lib/resource.txt b/tests/auto/cmake/test_resource_without_obj_lib/resource.txt deleted file mode 100644 index 7804a324a4..0000000000 --- a/tests/auto/cmake/test_resource_without_obj_lib/resource.txt +++ /dev/null @@ -1 +0,0 @@ -Test resource |