config.gni (1812B)
1 # Copyright 2015 The Chromium Authors 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 declare_args() { 6 # Native Client supports multiple toolchains: 7 # - nacl_glibc, based on gcc and glibc. 8 # - pnacl_newlib, based on llvm 3.7 and newlib (default). 9 # - saigo_newlib, based on llvm 12+ and newlib. 10 11 # True if nacl_glibc is used. 12 is_nacl_glibc = false 13 14 # True if saigo_newlib is used. 15 is_nacl_saigo = false 16 } 17 18 nacl_toolchain_dir = "//native_client/toolchain/${host_os}_x86" 19 20 if (is_nacl_glibc) { 21 if (target_cpu == "x86" || target_cpu == "x64") { 22 nacl_toolchain_package = "nacl_x86_glibc" 23 } else if (target_cpu == "arm") { 24 nacl_toolchain_package = "nacl_arm_glibc" 25 } 26 } else { 27 nacl_toolchain_package = "pnacl_newlib" 28 } 29 30 if (target_cpu == "pnacl") { 31 _nacl_tuple = "pnacl" 32 } else if (target_cpu == "x86" || target_cpu == "x64") { 33 _nacl_tuple = "x86_64-nacl" 34 } else if (target_cpu == "arm") { 35 _nacl_tuple = "arm-nacl" 36 } else if (target_cpu == "mipsel") { 37 _nacl_tuple = "mipsel-nacl" 38 } else { 39 # In order to allow this file to be included unconditionally 40 # from build files that can't depend on //components/nacl/features.gni 41 # we provide a dummy value that should be harmless if nacl isn't needed. 42 # If nacl *is* needed this will result in a real error, indicating that 43 # people need to set the toolchain path correctly. 44 _nacl_tuple = "unknown" 45 } 46 47 nacl_toolchain_bindir = "${nacl_toolchain_dir}/${nacl_toolchain_package}/bin" 48 nacl_toolchain_tooldir = 49 "${nacl_toolchain_dir}/${nacl_toolchain_package}/${_nacl_tuple}" 50 nacl_toolprefix = "${nacl_toolchain_bindir}/${_nacl_tuple}-" 51 52 nacl_irt_toolchain = "//chromium/build/toolchain/nacl:irt_" + target_cpu 53 is_nacl_irt = current_toolchain == nacl_irt_toolchain