blob: 2e3622152a1f649fa2cb787751d59bfd6254f5e1 [file] [log] [blame]
# Copyright 2017 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.
import("//packages/package.gni")
# go_run invokes a Go script to generate an output file
template("go_run") {
assert(defined(invoker.output), "go_run needs an 'output' file to generate")
action(target_name) {
visibility = [ "./*" ]
script = "//build/secondary/third_party/boringssl/go-run.py"
sources = invoker.sources
inputs = [
target_name,
]
outputs = [
"$target_gen_dir/" + invoker.output,
]
args = [
rebase_path("."),
rebase_path("$target_gen_dir/" + invoker.output),
rebase_path("//buildtools"),
rebase_path(target_name),
]
if (defined(invoker.args)) {
args += invoker.args
}
}
}
# See //third_party/boringssl/crypto/CMakeLists.txt
perlasm_sources = [
"//third_party/boringssl/crypto/perlasm/arm-xlate.pl",
"//third_party/boringssl/crypto/perlasm/ppc-xlate.pl",
"//third_party/boringssl/crypto/perlasm/x86_64-xlate.pl",
"//third_party/boringssl/crypto/perlasm/x86asm.pl",
"//third_party/boringssl/crypto/perlasm/x86gas.pl",
"//third_party/boringssl/crypto/perlasm/x86masm.pl",
"//third_party/boringssl/crypto/perlasm/x86nasm.pl",
]
template("perlasm") {
visibility = [ "./*" ]
assert(defined(invoker.sources),
"Need 'sources' in $target_name listing the perlasm scripts.")
asm_gen_target_name = target_name + "_gen"
if (current_cpu == "arm64") {
if (is_mac) {
perlasm_style = "ios64"
} else if (is_linux) {
perlasm_style = "linux64"
} else {
perlasm_style = "invalid"
}
} else if (current_cpu == "x64") {
if (is_mac) {
perlasm_style = "macosx"
} else if (is_fuchsia || is_linux) {
perlasm_style = "elf"
} else {
perlasm_style = "invalid"
}
}
action_foreach(asm_gen_target_name) {
forward_variables_from(invoker,
[
"sources",
"deps",
])
script = "//build/secondary/third_party/boringssl/crypto/perlasm.py"
inputs = perlasm_sources
outputs = [
"$target_gen_dir/{{source_name_part}}.S",
]
args = [
"perl",
"{{source}}",
perlasm_style,
rebase_path("$target_gen_dir/{{source_name_part}}.S"),
]
}
source_set(target_name) {
sources = get_target_outputs(":$asm_gen_target_name")
configs += [ "//third_party/boringssl:internal_config" ]
deps = [
":$asm_gen_target_name",
]
}
}
# See also //third_party/boringssl/sources.cmake
crypto_test_data = [
"crypto/cipher_extra/test/aes_128_cbc_sha1_ssl3_tests.txt",
"crypto/cipher_extra/test/aes_128_cbc_sha1_tls_implicit_iv_tests.txt",
"crypto/cipher_extra/test/aes_128_cbc_sha1_tls_tests.txt",
"crypto/cipher_extra/test/aes_128_cbc_sha256_tls_tests.txt",
"crypto/cipher_extra/test/aes_128_ctr_hmac_sha256.txt",
"crypto/cipher_extra/test/aes_128_gcm_siv_tests.txt",
"crypto/cipher_extra/test/aes_128_gcm_tests.txt",
"crypto/cipher_extra/test/aes_256_cbc_sha1_ssl3_tests.txt",
"crypto/cipher_extra/test/aes_256_cbc_sha1_tls_implicit_iv_tests.txt",
"crypto/cipher_extra/test/aes_256_cbc_sha1_tls_tests.txt",
"crypto/cipher_extra/test/aes_256_cbc_sha256_tls_tests.txt",
"crypto/cipher_extra/test/aes_256_cbc_sha384_tls_tests.txt",
"crypto/cipher_extra/test/aes_256_ctr_hmac_sha256.txt",
"crypto/cipher_extra/test/aes_256_gcm_siv_tests.txt",
"crypto/cipher_extra/test/aes_256_gcm_tests.txt",
"crypto/cipher_extra/test/chacha20_poly1305_tests.txt",
"crypto/cipher_extra/test/cipher_tests.txt",
"crypto/cipher_extra/test/des_ede3_cbc_sha1_ssl3_tests.txt",
"crypto/cipher_extra/test/des_ede3_cbc_sha1_tls_implicit_iv_tests.txt",
"crypto/cipher_extra/test/des_ede3_cbc_sha1_tls_tests.txt",
"crypto/cipher_extra/test/nist_cavp/aes_128_cbc.txt",
"crypto/cipher_extra/test/nist_cavp/aes_128_ctr.txt",
"crypto/cipher_extra/test/nist_cavp/aes_128_gcm.txt",
"crypto/cipher_extra/test/nist_cavp/aes_192_cbc.txt",
"crypto/cipher_extra/test/nist_cavp/aes_192_ctr.txt",
"crypto/cipher_extra/test/nist_cavp/aes_256_cbc.txt",
"crypto/cipher_extra/test/nist_cavp/aes_256_ctr.txt",
"crypto/cipher_extra/test/nist_cavp/aes_256_gcm.txt",
"crypto/cipher_extra/test/nist_cavp/tdes_cbc.txt",
"crypto/cipher_extra/test/nist_cavp/tdes_ecb.txt",
"crypto/curve25519/ed25519_tests.txt",
"crypto/ecdh/ecdh_tests.txt",
"crypto/evp/evp_tests.txt",
"crypto/evp/scrypt_tests.txt",
"crypto/fipsmodule/aes/aes_tests.txt",
"crypto/fipsmodule/bn/bn_tests.txt",
"crypto/fipsmodule/ec/p256-x86_64_tests.txt",
"crypto/fipsmodule/ecdsa/ecdsa_sign_tests.txt",
"crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt",
"crypto/fipsmodule/modes/gcm_tests.txt",
"crypto/fipsmodule/rand/ctrdrbg_vectors.txt",
"crypto/hmac_extra/hmac_tests.txt",
"crypto/poly1305/poly1305_tests.txt",
]