| # Copyright 2023 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # Assembly parts of generator 0.7.5 |
| # |
| # More advanced usages of might require more sophisticated |
| # build rules |
| |
| import("//build/rust/rustc_link_attribute.gni") |
| |
| generator_crate = "../../vendor/generator-0.7.5" |
| |
| static_library("asm-static") { |
| output_name = "asm" |
| if (current_cpu == "x64" && !is_mac) { |
| sources = [ "$generator_crate/src/detail/asm/asm_x86_64_sysv_elf_gas.S" ] |
| } else if (current_cpu == "x64" && is_mac) { |
| sources = [ "$generator_crate/src/detail/asm/asm_x86_64_sysv_macho_gas.S" ] |
| } else if (current_cpu == "arm64" && !is_mac) { |
| sources = [ "$generator_crate/src/detail/asm/asm_aarch64_aapcs_elf_gas.S" ] |
| } else if (current_cpu == "arm64" && is_mac) { |
| sources = |
| [ "$generator_crate/src/detail/asm/asm_aarch64_aapcs_macho_gas.S" ] |
| } else { |
| assert(false, "unsupported OS or CPU: $current_os/$current_cpu") |
| } |
| } |
| |
| rustc_link_attribute("asm") { |
| lib_name = "asm" |
| lib_static_target = ":asm-static" |
| } |