aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata-baremetal/external-static-libraries/external-static-libraries.qbs
blob: 6fbbb8647418575416175e5a457eb6d99d35a6b1 (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
import "../BareMetalApplication.qbs" as BareMetalApplication
import "../BareMetalStaticLibrary.qbs" as BareMetalStaticLibrary

Project {
    condition: {
        // The KEIL C51/C251/C166 toolchains support only a
        // full paths to the external libraries.
        if (qbs.toolchainType === "keil") {
            if (qbs.architecture === "mcs51"
                || qbs.architecture === "mcs251"
                || qbs.architecture === "c166") {
                console.info("unsupported toolset: %%"
                    + qbs.toolchainType + "%%, %%" + qbs.architecture + "%%");
                return false;
            }
        }
        return true;
    }
    property string outputLibrariesDirectory: sourceDirectory + "/libs"
    BareMetalStaticLibrary {
        name: "lib-a"
        destinationDirectory: project.outputLibrariesDirectory
        Depends { name: "cpp" }
        Properties {
            condition: qbs.targetOS.contains("darwin")
            bundle.isBundle: false
        }
        files: ["lib-a.c"]
    }
    BareMetalStaticLibrary {
        name: "lib-b"
        destinationDirectory: project.outputLibrariesDirectory
        Depends { name: "cpp" }
        Depends { name: "lib-a" }
        Properties {
            condition: qbs.targetOS.contains("darwin")
            bundle.isBundle: false
        }
        files: ["lib-b.c"]
    }
    BareMetalApplication {
        Depends { name: "lib-a"; cpp.link: false }
        Depends { name: "lib-b"; cpp.link: false }
        files: ["main.c"]
        cpp.libraryPaths: [project.outputLibrariesDirectory]
        cpp.staticLibraries: ["lib-b", "lib-a"]
    }
}