blob: 26f5fb056f3e162cb1a230ba73a8c31f8512e381 [file] [log] [blame]
Primiano Tucciae2879e2017-09-27 11:02:09 +09001# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15declare_args() {
16 is_debug = true
17 is_clang = true
Primiano Tucci0825bc82017-09-28 18:50:23 +010018}
Primiano Tucciae2879e2017-09-27 11:02:09 +090019
Primiano Tucci0825bc82017-09-28 18:50:23 +010020declare_args() {
Primiano Tucciae2879e2017-09-27 11:02:09 +090021 ar = "ar"
Primiano Tucciae2879e2017-09-27 11:02:09 +090022}
23
24# Platform detection
25if (target_os == "") {
26 target_os = host_os
27}
28if (current_os == "") {
29 current_os = target_os
30}
31
32is_android = current_os == "android"
33is_linux = current_os == "linux"
Primiano Tuccifffb1242017-11-27 09:41:36 +000034is_linux_host = host_os == "linux"
Primiano Tucciae2879e2017-09-27 11:02:09 +090035is_mac = current_os == "mac"
36
37if (target_cpu == "") {
38 target_cpu = host_cpu
39 if (is_android) {
40 target_cpu = "arm"
41 }
42}
43if (current_cpu == "") {
44 current_cpu = target_cpu
45}
46
47default_configs = [
Primiano Tucciae2879e2017-09-27 11:02:09 +090048 "//build:debug_symbols",
Primiano Tucci0825bc82017-09-28 18:50:23 +010049 "//build:default",
Primiano Tucciae2879e2017-09-27 11:02:09 +090050 "//build:extra_warnings",
Primiano Tucci0825bc82017-09-28 18:50:23 +010051 "//build:no_exceptions",
52 "//build:no_rtti",
Primiano Tucci7278dea2017-10-31 11:50:32 +000053 "//build/libc++:config",
Primiano Tucci0825bc82017-09-28 18:50:23 +010054 "//build/sanitizers:sanitizers_cflags",
Primiano Tucciae2879e2017-09-27 11:02:09 +090055]
56
57if (!is_debug) {
58 default_configs += [ "//build:release" ]
59}
60
61set_defaults("source_set") {
62 configs = default_configs
63}
64
65set_defaults("static_library") {
66 configs = default_configs
67}
68
Primiano Tucci7278dea2017-10-31 11:50:32 +000069# Realistically the only shared_library that we build right now is libc++.so
70# when use_custom_libcxx=true (on Linux). Hence don't add a dependency on
71# libc++ itself on these targets.
Primiano Tucciae2879e2017-09-27 11:02:09 +090072set_defaults("shared_library") {
73 configs = default_configs
Primiano Tucci0825bc82017-09-28 18:50:23 +010074 configs += [ "//build:shared_library" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +090075}
76
77set_defaults("executable") {
78 configs = default_configs
79 configs += [ "//build:executable" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +090080}
81
82set_default_toolchain("//build/toolchain:gcc_like")
83host_toolchain = "//build/toolchain:gcc_like_host"