# Copyright 2017 Google Inc. All Rights Reserved. { 'variables': { 'asm_target_arch%': 'none', 'has_nasm%': 'false', 'nasm_path%': 'nasm.exe', 'use_msan%': 'false', }, 'target_defaults': { 'includes': ['../disable_warnings.gypi'], 'cflags': [ '-fvisibility=hidden', ], 'msvs_settings': { 'VCCLCompilerTool': { # Disable warnings for third-party code. 'WarningLevel': '0', }, }, 'link_settings': { 'conditions': [ ['OS=="win"', { 'libraries': [ '-ladvapi32', ], }], ['OS=="mac" or OS=="ios"', { 'ldflags': [ '-lpthread', ], }], ['OS not in {"win","mac","ios"}', { 'libraries': [ '-lpthread', ], }], ], }, 'type': 'static_library', 'standalone_static_library': 1, 'hard_dependency': 1, }, 'targets': [ { 'target_name': 'crypto', 'toolsets' : [ 'target' ], # 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", |use_msan| has been set to # "true", or NASM is not available on Windows. ['asm_target_arch=="none" or use_msan=="true" 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 in {"x86-64", "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)', ], }], ['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 in {"x86-64", "x64"}', { '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=="mac"', { 'conditions': [ ['asm_target_arch=="x86"', { 'sources': [ '<@(boringssl_mac_x86_files)', ], }], ['asm_target_arch in {"x86-64", "x64"}', { 'sources': [ '<@(boringssl_mac_x86_64_files)', ], }], ], }], ['OS=="ios"', { 'conditions': [ ['asm_target_arch in {"x86-64", "x64"}', { 'sources': [ '<@(boringssl_mac_x86_64_files)', ], }], ['asm_target_arch=="arm"', { 'sources': [ '<@(boringssl_ios_arm_files)', ], }], ['asm_target_arch=="arm64"', { 'sources': [ '<@(boringssl_ios_aarch64_files)', ], }], ], }], ], }], ], }, { 'target_name': 'ssl', 'toolsets' : [ 'target' ], # 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', ], }, }, ], }