-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILDCONFIG.gn
77 lines (59 loc) · 1.82 KB
/
BUILDCONFIG.gn
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
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is a (heavily modified) version of Chromium's BUILDCONFIG.gn.
if (target_os == "") {
target_os = host_os
}
if (target_cpu == "") {
target_cpu = host_cpu
}
if (host_os == "win") {
_default_toolchain = "//build/toolchain/win:win_clang_$target_cpu"
} else {
assert(false, "Currently unsupported host os.")
}
# This is just temporary, as we only support Windows for now.
current_os = "win"
is_android = current_os == "android"
is_ios = current_os == "ios"
is_linux = current_os == "linux"
is_mac = current_os == "mac"
is_win = current_os == "win"
is_posix = !is_win
symbol_level = 2
set_default_toolchain(_default_toolchain)
declare_args() {
is_debug = false
opt_level = 0
}
# TODO: sources filters (e.g. *_win.* or *_mac.*) might be a good thing to add.
default_compiler_configs = [
"//build/config:default_include_dirs",
"//build/config:cpp17"
]
if (is_win) {
default_compiler_configs += [
"//build/config/win:dynamic_crt",
"//build/config/win:lean_and_mean",
"//build/config/win:nominmax",
"//build/config/win:optimization_level",
]
}
set_defaults("static_library") {
configs = default_compiler_configs
}
set_defaults("source_set") {
configs = default_compiler_configs
}
# TODO: Add some default executable configs (e.g. incremental linking, target console subsystem by default, etc).
default_executable_configs = default_compiler_configs
set_defaults("executable") {
configs = default_executable_configs
}
# TODO: Add some default shared library configs.
default_shared_library_configs = default_compiler_configs
set_defaults("shared_library") {
configs = default_shared_library_configs
}
# TODO: Add support for loadable_modules?