summaryrefslogtreecommitdiff
path: root/tests/console/xmake.xproj
blob: 5a6a943770ebd96ada69db21b18db6a52b99c645 (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
[
    -- get configs
    local configs = import("configs")
    assert(configs)

    -- the custom script
    function add(a, b)
        return a + b
    end
]
project: console
{
    # the modes
    modes: debug 
    {
        symbols: debug
        warnings: all
        optimize: none
        cxflags: -fsanitize=address -ftrapv
    }

    modes: release 
    {
        strip: all
        symbols: hidden
        cflags: -Wno-error=deprecated-declarations
        warnings: all
        optimize: smallest
        vectorexts: sse2, ssse3, mmx
    }

    modes: profile 
    {
        symbols: debug
        warnings: none
        optimize: fastest
    }

    target: hello1
    {
        kind:           static
        files:          src/hello1/*.c
    }

    target: hello2
    {
        kind:           shared
        files:          $(projectdir)/src/hello2/*.c
    }

    target: hello3
    {
        kind:           static
        files:          src/hello3/*.c 
        headers:        src/hello3/*.h
        headerdir:      $(buildir)/inc
        targetdir:      $(buildir)/lib
        objectdir:      $(buildir)/obj
    }

    target: demo_c
    {
        kind:           binary
        deps:           hello1 
        files:          src/demo/*.c
        links:          hello1
        linkdirs:       $(buildir)
        includedirs:    $(buildir)
        cflags:         -DHELLO1

        # the modes
        modes: release 
        {
            defines: NDEBUG
        }
    }

    target: demo_cpp
    {
        kind:           binary
        deps:           hello2 
        files:          src/demo/*.cpp 
        version:        1.0.1
        configfile:     $(buildir)/demo_cpp.h
        linkdirs:       $(buildir)
        includedirs:    $(buildir)
        switches:       AAA_ENABLE
        switches:       CCC_ENABLE
        switches:       FFF_ENABLE, KKK_ENABLE
        switchfiles:    plat/demo_cpp.xswf
        undefines:      HELLO2
        cxxflags:       -DHELLO1 
                    ,   [_if (AAA_ENABLE, "-DAAA")]
                    ,   [_if (BBB_ENABLE, "-DBBB")]
                    ,   [_if (CCC_ENABLE, "-DCCC")]
                    ,   [_ifelse (DDD_ENABLE, "-DDDD", "-DEEE")]
                    ,   [_ifelse (KKK_ENABLE, "-DKKK", "-DFFF")]
    }

    platforms: macosx, ios 
    {
        target: demo_objc
        {
            kind:           binary
            deps:           hello3 
            files:          src/demo/*.m 
            links:          hello3 
            linkdirs:       $(buildir)/lib 
            includedirs:    $(buildir)/inc 
            mflags:         -DHELLO3, -DPLAT="macosx", -DARCH='armv7, arm64', -DVERSION=[add(1, 2)] 
        }

        target: demo_objcpp
        {
            kind:           binary
            deps:           hello3 
            files:          src/demo/*.mm 
            mxflags:        -DHELLO3 
            ldflags:        -L$(buildir)/lib, -lhello3, -lhello3

            platforms: ios 
            {
                ldflags:    -framework Cocoa, "-framework IOKit"
                       ,    -framework CoreFoundation
            }
        }
    }
}