blob: a49f0d43b1fb723437912504000c9a02fa57c5a5 [file] [log] [blame]
# Copyright 2017 Google Inc. All Rights Reserved.
{
'variables': {
'asm_target_arch%': '<(target_arch)',
'boringssl_root%': '<(DEPTH)/third_party/boringssl/src',
'optimize_target_for_speed': 1,
},
'target_defaults': {
# Turn off bad-function-cast warning, as BoringSSL violates this sometimes.
'defines': [
'PURIFY',
'TERMIO',
'_REENTRANT',
],
'cflags': [
'-fPIC',
'-fvisibility=hidden',
],
'cflags_c': [
'-std=gnu99',
'-Wno-bad-function-cast',
],
'cflags_c!': [
'-Wbad-function-cast',
],
'ldflags': [
'-fPIC',
],
'type': '<(library)',
'conditions': [
['OS=="starboard"', {
'variables': {
'openssl_config_path': '<(boringssl_root)/config/starboard',
},
'dependencies': [
'<(DEPTH)/starboard/client_porting/eztime/eztime.gyp:eztime',
'<(DEPTH)/starboard/starboard_headers_only.gyp:starboard_headers_only',
],
'sources': [
'<(boringssl_root)/crypto/rand_extra/starboard.c',
'<(boringssl_root)/crypto/cpu-starboard.c',
],
'sources!': [
'<(boringssl_root)/crypto/bio/connect.c',
'<(boringssl_root)/crypto/bio/fd.c',
'<(boringssl_root)/crypto/bio/socket.c',
'<(boringssl_root)/crypto/bio/socket_helper.c',
'<(boringssl_root)/crypto/rand_extra/deterministic.c',
'<(boringssl_root)/crypto/rand_extra/fuchsia.c',
'<(boringssl_root)/crypto/rand_extra/windows.c',
],
}],
['OS=="starboard"', {
'defines': [
'NO_SYS_PARAM_H',
'NO_SYS_UN_H',
'NO_SYSLOG',
'OPENSSL_NO_CAMELLIA',
'OPENSSL_NO_CAPIENG',
'OPENSSL_NO_CAST',
'OPENSSL_NO_CMS',
'OPENSSL_NO_DYNAMIC_ENGINE',
'OPENSSL_NO_EC_NISTP_64_GCC_128',
'OPENSSL_NO_GMP',
'OPENSSL_NO_IDEA',
'OPENSSL_NO_JPAKE',
'OPENSSL_NO_KRB5',
'OPENSSL_NO_MDC2',
'OPENSSL_NO_OCSP',
'OPENSSL_NO_RC5',
'OPENSSL_NO_RFC3779',
'OPENSSL_NO_SCTP',
'OPENSSL_NO_SEED',
'OPENSSL_NO_STORE',
'OPENSSL_NO_SOCK', # Added by Cobalt to remove unused socket code.
'OPENSSL_NO_WHIRLPOOL',
'OPENSSL_NO_POSIX_IO',
],
}], # OS == "starboard"
],
'include_dirs': [
'.',
'<@(openssl_config_path)',
],
'all_dependent_settings': {
'include_dirs': [
'<@(openssl_config_path)',
],
},
},
'targets': [
{
'target_name': 'crypto',
# Include the source file list generated by BoringSSL
'includes': ['boringssl.gypi',],
'sources': [
'<@(boringssl_crypto_files)',
'<@(boringssl_ssl_files)',
],
'include_dirs': [
'<(boringssl_root)/include',
],
'all_dependent_settings': {
'include_dirs': [
'<(boringssl_root)/include',
],
},
'conditions': [
# This massive, nested conditional block will select the correct batch
# of assembly language files for the current OS and CPU architecture, or
# it will turn off assembly language files entirely if the
# |asm_target_arch| has been set to "none".
['target_os not in ["linux", "android", "tvos"] or asm_target_arch not in ["x86", "x64", "arm", "arm64"]', {
# please read comments for |target_os=="win"| condition below
'defines': [
'OPENSSL_NO_ASM',
],
}, { # target_os in ["linux", "android", "tvos"] and asm_target_arch in ["none", "mips", "ia32"]
'conditions': [
['target_os=="linux" or target_os=="android"', {
'conditions': [
['asm_target_arch=="x86"', {
'sources': [
'<@(boringssl_linux_x86_files)',
],
}],
['asm_target_arch=="x64"', {
'sources': [
'<@(boringssl_linux_x86_64_files)',
],
}],
['asm_target_arch=="arm"', {
'sources': [
'<@(boringssl_linux_arm_files)',
],
}],
['asm_target_arch=="arm64"', {
'sources': [
'<@(boringssl_linux_aarch64_files)',
],
}],
],
}],
['target_os=="win"', {
# For |target_os=="win"| an ASM rule uses ml.exe (aka MS Macro Assembler)
# which we can't use with GNU format. As soon as ASM rule will be fixed
# for using GNU Assembler, to accelerate "crypto" with assembler
# implementations just remove target_os=="win" from abowe condition
# |'asm_target_arch=="none" or target_os=="win"'| which currently
# sets OPENSSL_NO_ASM for "win" too
'conditions': [
['asm_target_arch=="x86"', {
'sources': [
'<@(boringssl_win_x86_files)',
],
}],
['asm_target_arch=="x64"', {
'sources': [
'<@(boringssl_win_x86_64_files)',
],
}],
],
}],
['target_os=="tvos"', {
'conditions': [
['asm_target_arch=="arm64"', {
'sources': [
'<@(boringssl_ios_aarch64_files)',
],
}],
# Simulator
['asm_target_arch=="x64"', {
'defines': [
'OPENSSL_NO_ASM',
],
}],
],
}]
],
}],
],
},
],
}