summaryrefslogtreecommitdiffstats
path: root/python/mozbuild/mozbuild/test/configure/data/set_define.configure
blob: ce9a60d7f1a81de8d91fda8c98c3edd1764b1abd (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
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

option("--set-foo", help="set foo")


@depends("--set-foo")
def foo(value):
    if value:
        return True


set_define("FOO", foo)


option("--set-bar", help="set bar")


@depends("--set-bar")
def bar(value):
    return bool(value)


set_define("BAR", bar)


option("--set-value", nargs=1, help="set value")


@depends("--set-value")
def set_value(value):
    if value:
        return value[0]


set_define("VALUE", set_value)


option("--set-name", nargs=1, help="set name")


@depends("--set-name")
def set_name(value):
    if value:
        return value[0]


set_define(set_name, True)