blob: 7013dd5bfe10852205b2accddcf35ed0dfd53b74 [file] [log] [blame]
# Copyright (c) 2014 The Native Client 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 is the root build file for GN. GN will start processing by loading this
# file, and recursively load all dependencies until all dependencies are either
# resolved or known not to exist (which will cause the build to fail). So if
# you add a new build file, there must be some path of dependencies from this
# file to your new one or GN won't know about it.
#
# All targets in this file file are built by default.
#
# Here we declare the meta targets which pull in the various architecture
# combinations of the real targets.
#
declare_args() {
# Trusted architecture
use_trusted_x86 = (cpu_arch == "x86")
use_trusted_x64 = ((cpu_arch == "x64") || (os == "win"))
use_trusted_arm = (cpu_arch == "arm")
# Untrusted architecture
use_nacl_x86 = (cpu_arch == "x86")
use_nacl_x64 = ((cpu_arch == "x64") || (os == "win"))
use_nacl_arm = (cpu_arch == "arm")
# Untrusted libc
use_gcc_newlib = true
use_gcc_glibc = false
use_clang_newlib = false
}
trusted_deps = []
if (use_trusted_x86) {
group("trusted_x86") {
deps = [
"//native_client/src:trusted_targets(//native_client/build/toolchain/$os:trusted_x86)",
]
}
trusted_deps += [":trusted_x86"]
}
if (use_trusted_x64) {
group("trusted_x64") {
deps = [
"//native_client/src:trusted_targets(//native_client/build/toolchain/$os:trusted_x64)",
]
}
trusted_deps += [":trusted_x64"]
}
if (use_trusted_arm) {
group("trusted_arm") {
deps = [
"//native_client/src:trusted_targets(//native_client/build/toolchain/$os:trusted_arm)",
]
}
trusted_deps += [":trusted_arm"]
}
group("trusted") {
deps = trusted_deps
}
#
# This is the root untrusted target which will build all trusted components
#
group("untrusted") {
deps = []
if (use_nacl_x86) {
if (use_gcc_newlib) {
deps += [
"//native_client/src/:untrusted_targets(//native_client/build/toolchain/nacl:newlib_x86)",
]
}
if (use_gcc_glibc) {
deps += [
"//native_client/src/:untrusted_targets(//native_client/build/toolchain/nacl:glibc_x86)"
]
}
if (use_clang_newlib) {
deps += [
"//native_client/src/:untrusted_targets(//native_client/build/toolchain/nacl:clang_newlib_x86)",
]
}
deps += [
"//native_client/src/:irt_targets(//native_client/build/toolchain/nacl:irt_x86)"
]
}
if (use_nacl_x64) {
if (use_gcc_newlib) {
deps += [
"//native_client/src/:untrusted_targets(//native_client/build/toolchain/nacl:newlib_x64)",
]
}
if (use_gcc_glibc) {
deps += [
"//native_client/src/:untrusted_targets(//native_client/build/toolchain/nacl:glibc_x64)"
]
}
if (use_clang_newlib) {
deps += [
"//native_client/src/:untrusted_targets(//native_client/build/toolchain/nacl:clang_newlib_x64)",
]
}
deps += [
"//native_client/src/:irt_targets(//native_client/build/toolchain/nacl:irt_x64)"
]
}
if (use_nacl_arm) {
if (use_gcc_newlib) {
deps += [
"//native_client/src/:untrusted_targets(//native_client/build/toolchain/nacl:newlib_arm)",
]
}
# No gcc build, yet.
deps += [
"//native_client/src/:irt_targets(//native_client/build/toolchain/nacl:irt_arm)"
]
}
}