| # Copyright 2019 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/chromeos/ui_mode.gni") |
| |
| assert(is_chromeos) |
| |
| config("compiler_cpu_abi") { |
| # These flags are added by the Chrome OS toolchain compiler wrapper, |
| # or are implicitly passed by Chome OS's toolchain's clang due to |
| # the cmake flags that clang was built with. Passing them redundantly |
| # is harmless and prepares for using Chromium's toolchain. |
| if (is_chromeos_device) { |
| if (current_cpu == "x64") { |
| asmflags = [ "--target=x86_64-cros-linux-gnu" ] |
| cflags = [ |
| "--target=x86_64-cros-linux-gnu", |
| "-mno-movbe", |
| ] |
| ldflags = [ |
| "--target=x86_64-cros-linux-gnu", |
| "-mno-movbe", |
| ] |
| } else if (current_cpu == "arm") { |
| asmflags = [ "--target=armv7a-cros-linux-gnueabihf" ] |
| cflags = [ "--target=armv7a-cros-linux-gnueabihf" ] |
| ldflags = [ "--target=armv7a-cros-linux-gnueabihf" ] |
| } else if (current_cpu == "arm64") { |
| asmflags = [ "--target=aarch64-cros-linux-gnu" ] |
| cflags = [ "--target=aarch64-cros-linux-gnu" ] |
| ldflags = [ "--target=aarch64-cros-linux-gnu" ] |
| } else { |
| assert(false, "add support for $current_cpu here") |
| } |
| } |
| } |
| |
| config("runtime_library") { |
| # These flags are added by the Chrome OS toolchain compiler wrapper, |
| # or are implicitly passed by Chome OS's toolchain's clang due to |
| # the cmake flags that clang was built with. Passing them redundantly |
| # is harmless and prepares for using Chromium's toolchain. |
| if (is_chromeos_device) { |
| ldflags = [ |
| "--rtlib=compiler-rt", |
| "--unwindlib=libunwind", |
| ] |
| } |
| } |