| # 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() { |
| # Untrusted architecture |
| use_nacl_x86 = target_cpu == "x86" |
| use_nacl_x64 = target_cpu == "x64" || target_os == "win" |
| use_nacl_arm = target_cpu == "arm" |
| |
| # Untrusted libc |
| use_gcc_glibc = false |
| use_clang_newlib = true |
| } |
| |
| group("trusted") { |
| deps = [ |
| "//native_client/src:trusted_targets", |
| ] |
| } |
| |
| |
| # |
| # This is the root untrusted target which will build all trusted components |
| # |
| group("untrusted") { |
| deps = [] |
| if (use_nacl_x86) { |
| if (use_gcc_glibc) { |
| deps += [ "//native_client/src/:untrusted_targets(//build/toolchain/nacl:glibc_x86)" ] |
| } |
| if (use_clang_newlib) { |
| deps += [ "//native_client/src/:untrusted_targets(//build/toolchain/nacl:clang_newlib_x86)" ] |
| } |
| deps += [ "//native_client/src/:irt_targets(//build/toolchain/nacl:irt_x86)" ] |
| } |
| if (use_nacl_x64) { |
| if (use_gcc_glibc) { |
| deps += [ "//native_client/src/:untrusted_targets(//build/toolchain/nacl:glibc_x64)" ] |
| } |
| if (use_clang_newlib) { |
| deps += [ "//native_client/src/:untrusted_targets(//build/toolchain/nacl:clang_newlib_x64)" ] |
| } |
| deps += [ "//native_client/src/:irt_targets(//build/toolchain/nacl:irt_x64)" ] |
| } |
| if (use_nacl_arm) { |
| if (use_gcc_glibc) { |
| deps += [ "//native_client/src/:untrusted_targets(//build/toolchain/nacl:glibc_arm)" ] |
| } |
| if (use_clang_newlib) { |
| deps += [ "//native_client/src/:untrusted_targets(//build/toolchain/nacl:clang_newlib_arm)" ] |
| } |
| |
| deps += [ "//native_client/src/:irt_targets(//build/toolchain/nacl:irt_arm)" ] |
| } |
| } |