summaryrefslogtreecommitdiff
path: root/tests/auto/language/testdata/exports.qbs
blob: cc86b1e4af1543712469410851f95ddee73202a9 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import "exports_product.qbs" as ProductWithInheritedExportItem

Project {
    Application {
        name: "myapp"
        Depends { name: "mylib" }
        Depends { name: "dummy" }
        Depends { name: "qbs" }
        dummy.defines: ["BUILD_" + product.name.toUpperCase()]
        dummy.includePaths: ["./app"]
    }

    references: [
        "subdir/exports-mylib.qbs",
        "subdir2/exports-mylib2.qbs"
    ]

    Application {
        name: "A"
        Depends { name: "qbs" }
        Depends { name: "B" }
    }
    StaticLibrary {
        name: "B"
        Export {
            Depends { name: "C" }
            Depends { name: "qbs" }
        }
    }
    StaticLibrary {
        name: "C"
        Export {
            Depends { name: "D" }
            Depends { name: "qbs" }
        }
    }
    StaticLibrary {
        name: "D"
    }

    Application {
        name: "myapp2"
        Depends { name: "productWithInheritedExportItem" }
        Depends { name: "qbs" }
    }
    ProductWithInheritedExportItem {
        name: "productWithInheritedExportItem"
        Export {
            dummy.cFlags: base.concat("PRODUCT_" + product.name.toUpperCase())
            dummy.cxxFlags: ["-bar"]
            Properties {
                condition: true
                dummy.defines: base.concat(["DEF"])
            }
        }
    }
    Application {
        name: "myapp3"
        Depends { name: "productWithInheritedExportItem"; versionAtLeast: "2.0" }
    }

    Project {
        name: "sub1"
        Product {
            name: "sub p1"
            Export {
                Depends { name: "dummy" }
                dummy.someString: project.name
            }
        }
    }

    Project {
        name: "sub2"
        Product {
            name: "sub p2"
            Depends { name: "sub p1" }
        }
    }

    ParentWithExport {
        name: "libA"
        Export { Depends { name: "libB" } }
    }

    ParentWithExport { name: "libB" }

    ParentWithExport {
        name: "libC"
        Export { Depends { name: "libA" } }
    }

    ParentWithExport {
        name: "libD"
        Export { Depends { name: "libA" } }
    }

    Product {
        name: "libE"

        Depends { name: "libD" }
        Depends { name: "libC" }

        Group {
            qbs.install: false
        }
    }

    Product {
        name: "dependency"

        Probe {
            id: configProbe
            property var config
            configure: {
                var obj = {};
                obj.featureX = true;
                obj.featureY = false;
                obj.featureZ = true;
                config = obj;
                found = true;
            }
        }
        property var config: configProbe.config

        Export {
            property bool depend: false
            property var config: product.config
            Depends { condition: depend; name: "cpp" }
            Properties { condition: depend; cpp.includePaths: ["."] }
        }
    }
    Product {
        name: "depender"
        Depends { name: "dependency" }
        property bool featureX: dependency.config.featureX
        property bool featureY: dependency.config.featureY
        property bool featureZ: dependency.config.featureZ
    }

    Product {
        name: "broken_cycle1"
        Export {
            property bool depend: true
            Depends { name: "broken_cycle3"; condition: depend }                                                                                                                                                                                                }
        }
    Product {
        name: "broken_cycle2"
        Export {
            Depends { name: "broken_cycle1" }
            broken_cycle1.depend: false
       }
    }
    Product {
        name: "broken_cycle3"
        Depends { name: "broken_cycle2" }
    }
}