Files
ce_cdm/third_party/boringssl/boringssl.gyp
2019-03-29 18:16:05 -07:00

257 lines
6.6 KiB
Python

# Copyright 2017 Google Inc. All Rights Reserved.
{
'variables': {
'asm_target_arch%': 'none',
'has_nasm%': 'false',
'nasm_path%': 'nasm.exe',
},
'target_defaults': {
'cflags': [
'-g',
'-fPIC',
'-fvisibility=hidden',
# BoringSSL violates these warnings
'-Wno-cast-qual',
],
'cflags!': [
'-Wbad-function-cast',
'-Wcast-qual',
],
'cflags_cc!': [
'-Wbad-function-cast',
'-Wcast-qual',
],
'cflags_c': [
# BoringSSL violates these warnings
'-Wno-bad-function-cast',
],
'cflags_c!': [
'-Wbad-function-cast',
'-Wcast-qual',
],
'msvs_settings': {
'VCCLCompilerTool': {
# Disable warnings for third-party code.
'WarningLevel': '0',
},
},
'ldflags': [
'-fPIC',
],
'link_settings': {
'ldflags': [
'-lpthread',
],
},
'link_settings': {
'conditions': [
['OS=="win"', {
'libraries': [
'-ladvapi32',
],
}],
],
},
'direct_dependent_settings': {
# BoringSSL's exported headers fail these warnings
'cflags': [
'-Wno-unknown-warning-option',
'-Wno-cast-qual',
],
'cflags!': [
'-Wbad-function-cast',
'-Wcast-qual',
],
'cflags_c': [
'-Wno-bad-function-cast',
],
'cflags_c!': [
'-Wbad-function-cast',
'-Wcast-qual',
],
'cflags_cc!': [
'-Wbad-function-cast',
'-Wcast-qual',
],
},
'type': 'static_library',
'standalone_static_library': 1,
},
'targets': [
{
'target_name': 'crypto',
# Include the source file list generated by BoringSSL
'includes': ['kit/boringssl.gypi'],
'sources': [
'<@(boringssl_crypto_files)',
],
'include_dirs': [
'kit/src/include',
],
'direct_dependent_settings': {
'include_dirs': [
'kit/src/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".
['asm_target_arch=="none" or (OS=="win" and has_nasm!="true")', {
'defines': [
'OPENSSL_NO_ASM',
],
}, { # asm_target_arch!="none"
'conditions': [
['OS=="linux" or OS=="android"', {
'conditions': [
['asm_target_arch=="x86"', {
'sources': [
'<@(boringssl_linux_x86_files)',
],
}],
['asm_target_arch=="x86-64"', {
'sources': [
'<@(boringssl_linux_x86_64_files)',
],
}],
['asm_target_arch=="arm"', {
'sources': [
'<@(boringssl_linux_arm_files)',
],
}],
['asm_target_arch=="arm64"', {
'sources': [
'<@(boringssl_linux_aarch64_files)',
],
}],
['asm_target_arch=="ppc64"', {
'sources': [
'<@(boringssl_linux_ppc64le_files)',
],
}],
],
}],
['OS=="win"', {
'conditions': [
# TODO: This doesn't allow building the Debug/Release
# configurations with x86-64, it requires using the
# Debug_x64/Release_x64 configurations.
['asm_target_arch=="x86"', {
'sources': [
'<@(boringssl_win_x86_files)',
],
'variables': {
'nasm_flags': [
'-fwin32',
],
},
}],
['asm_target_arch=="x86-64"', {
'sources': [
'<@(boringssl_win_x86_64_files)',
],
'variables': {
'nasm_flags': [
'-fwin64',
],
},
}],
],
'rules': [
{
# We need a custom rule to generate asm files since it uses
# NASM syntax and not MSVC syntax.
'rule_name': 'nasm',
'extension': 'asm',
'message': 'NASM <(RULE_INPUT_PATH)',
'msvs_external_rule': 1,
'process_outputs_as_sources': 1,
'msvs_cygwin_shell': 0,
'outputs': [
'<(INTERMEDIATE_DIR)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)_asm.obj'
],
'action': [
'<(nasm_path)',
'-o',
'<@(_outputs)',
'<@(nasm_flags)',
'<(RULE_INPUT_PATH)',
],
},
],
}],
['OS=="osx"', {
'conditions': [
['asm_target_arch=="x86"', {
'sources': [
'<@(boringssl_mac_x86_files)',
],
}],
['asm_target_arch=="x86-64"', {
'sources': [
'<@(boringssl_mac_x86_64_files)',
],
}],
],
}],
['OS=="ios"', {
'conditions': [
['asm_target_arch=="arm"', {
'sources': [
'<@(boringssl_ios_arm_files)',
],
}],
['asm_target_arch=="arm64"', {
'sources': [
'<@(boringssl_ios_aarch64_files)',
],
}],
],
}],
],
}],
],
},
{
'target_name': 'ssl',
# Include the source file list generated by BoringSSL
'includes': ['kit/boringssl.gypi'],
'dependencies': [
'crypto',
],
'sources': [
'<@(boringssl_ssl_files)',
],
'include_dirs': [
'kit/src/include',
],
'direct_dependent_settings': {
'include_dirs': [
'kit/src/include',
],
},
'cflags_cc': [
'-Wno-cast-align',
],
'cflags_cc!': [
'-Wcast-align',
],
},
],
}