[NaCl SDK]: use standard __BEGIN_DECLS macros in sys/select.h
[chromium-blink-merge.git] / third_party / boringssl / BUILD.gn
blob7337461f13f77520708fae76cd5527576cca1531
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # Config for us and everybody else depending on BoringSSL.
6 config("openssl_config") {
7   include_dirs = []
8   include_dirs += [ "src/include" ]
9   if (is_component_build) {
10     defines = [
11       "BORINGSSL_SHARED_LIBRARY",
12     ]
13   }
16 # Config internal to this build file.
17 config("openssl_internal_config") {
18   visibility = [ ":*" ]  # Only targets in this file can depend on this.
21 # The list of BoringSSL files is kept in boringssl.gypi.
22 gypi_values = exec_script(
23     "//build/gypi_to_gn.py",
24     [ rebase_path("//third_party/boringssl/boringssl.gypi") ],
25     "scope",
26     [ "//third_party/boringssl/boringssl.gypi" ])
28 component("boringssl") {
29   sources = gypi_values.boringssl_lib_sources
31   direct_dependent_configs = [ ":openssl_config" ]
33   cflags = []
34   defines = [ "BORINGSSL_IMPLEMENTATION" ]
35   if (is_component_build) {
36     defines += [
37       "BORINGSSL_SHARED_LIBRARY",
38     ]
39   }
41   configs -= [ "//build/config/compiler:chromium_code" ]
42   configs += [ "//build/config/compiler:no_chromium_code" ]
44   # Also gets the include dirs from :openssl_config
45   include_dirs = [
46     "src/include",
47     # This is for arm_arch.h, which is needed by some asm files. Since the
48     # asm files are generated and kept in a different directory, they
49     # cannot use relative paths to find this file.
50     "src/crypto",
51   ]
53   if (cpu_arch == "x64") {
54     if (is_mac) {
55       sources += gypi_values.boringssl_mac_x86_64_sources
56     } else if (is_linux || is_android) {
57       sources += gypi_values.boringssl_linux_x86_64_sources
58     } else if (is_win) {
59       sources += gypi_values.boringssl_win_x86_64_sources
60     } else {
61       defines += [ "OPENSSL_NO_ASM" ]
62     }
63   } else if (cpu_arch == "x86") {
64     if (is_mac) {
65       sources += gypi_values.boringssl_mac_x86_sources
66     } else if (is_linux || is_android) {
67       sources += gypi_values.boringssl_linux_x86_sources
68     } else {
69       defines += [ "OPENSSL_NO_ASM" ]
70     }
71   } else if (cpu_arch == "arm") {
72     sources += gypi_values.boringssl_linux_arm_sources
73   } else {
74     defines += [ "OPENSSL_NO_ASM" ]
75   }