summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qstring/CMakeLists.txt
blob: 80917554d231c3a70ea31205e1b368231150383e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
    cmake_minimum_required(VERSION 3.16)
    project(tst_qstring LANGUAGES CXX)
    find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
endif()

if(NOT QT_FEATURE_doubleconversion AND NOT QT_FEATURE_system_doubleconversion)
    list(APPEND tst_qstring_extra_defines QT_NO_DOUBLECONVERSION)
endif()

if(APPLE)
    list(APPEND tst_qstring_extra_libraries ${FWFoundation})
    list(APPEND tst_qstring_extra_sources tst_qstring_mac.mm)
endif()
if(WASM)
    list(APPEND tst_qstring_extra_sources tst_qstring_wasm.cpp)
endif()

foreach(test tst_qstring tst_qstring_restricted_ascii tst_qstring_no_cast_from_ascii)
    qt_internal_add_test(${test}
        NO_BATCH
        SOURCES
            tst_qstring.cpp
            ${tst_qstring_extra_sources}
        LIBRARIES
            Qt::CorePrivate
            Qt::TestPrivate
            ${tst_qstring_extra_libraries}
        DEFINES
            ${tst_qstring_extra_defines}
    )
endforeach()

qt_internal_extend_target(tst_qstring_restricted_ascii
    DEFINES
        QT_RESTRICTED_CAST_FROM_ASCII
        tst_QString=tst_QString_restricted_ascii
)

qt_internal_extend_target(tst_qstring_no_cast_from_ascii
    DEFINES
        QT_NO_CAST_FROM_ASCII
        tst_QString=tst_QString_no_cast_from_ascii
)