Chromium Code Reviews| Index: BUILD.gn |
| =================================================================== |
| --- BUILD.gn (revision 263272) |
| +++ BUILD.gn (working copy) |
| @@ -1,4 +1,93 @@ |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +# Config for us and everybody else depending on openssl. |
| +config("openssl_config") { |
| + include_dirs = [] |
| + if (cpu_arch == "x64") { |
| + # Ensure the 64-bit opensslconf.h header is used in preference to the one |
| + # in openssl/include. |
| + include_dirs += [ "config/x64" ] |
| + } |
| + |
| + include_dirs += [ "openssl/include" ] |
| +} |
| + |
| +# Config internal to this build file. |
| +config("openssl_internal_config") { |
| + visibility = ":*" # Only targets in this file can depend on this. |
| +} |
| + |
| +# The list of OpenSSL files is kept in skia_gn_files.gypi. Read it. |
|
tfarina
2014/04/11 18:19:36
skia_gn_files.gypi? I think you meant openssl.gypi
|
| +gypi_values = exec_script( |
| + "//build/gypi_to_gn.py", |
| + [ rebase_path("//third_party/openssl/openssl.gypi") ] |
| + "scope", |
| + [ "//third_party/openssl/openssl.gypi" ]) |
| + |
| component("openssl") { |
| - external = true |
| - gyp_file = "openssl.gyp" |
| + sources = gypi_values.openssl_common_sources |
| + |
| + defines = gypi_values.openssl_common_defines |
| + defines += [ |
| + "PURIFY", |
| + "MONOLITH", |
| + ] |
| + |
| + direct_dependent_configs = [ ":openssl_config" ] |
| + |
| + cflags = [] |
| + |
| + # Also gets the include dirs from :openssl_config |
| + include_dirs = [ |
| + ".", |
| + "openssl", |
| + "openssl/crypto", |
| + "openssl/crypto/asn1", |
| + "openssl/crypto/evp", |
| + "openssl/crypto/modes", |
| + ] |
| + |
| + if (is_posix && !is_android) { |
| + defines += [ |
| + # ENGINESDIR must be defined if OPENSSLDIR is. |
| + "ENGINESDIR=\"/dev/null\"", |
| + # Set to ubuntu default path for convenience. If necessary, override |
| + # this at runtime with the SSL_CERT_DIR environment variable. |
| + "OPENSSLDIR=\"/etc/ssl\"", |
| + ] |
| + } |
| + |
| + if (cpu_arch == "x64") { |
| + sources += gypi_values.openssl_x86_64_sources |
| + sources -= gypi_values.openssl_x86_64_source_excludes |
| + defines += gypi_values.openssl_x86_64_defines |
| + } else if (cpu_arch == "x86") { |
| + sources += gypi_values.openssl_x86_sources |
| + sources -= gypi_values.openssl_x86_source_excludes |
| + defines += gypi_values.openssl_x86_defines |
| + } else if (cpu_arch == "arm") { |
| + sources += gypi_values.openssl_arm_sources |
| + sources -= gypi_values.openssl_arm_source_excludes |
| + defines += gypi_values.openssl_arm_defines |
| + } else if (cpu_arch == "mips") { |
| + sources += gypi_values.openssl_mips_sources |
| + sources -= gypi_values.openssl_mips_source_excludes |
| + defines += gypi_values.openssl_mips_defines |
| + } |
| + |
| + if (is_clang) { |
| + cflags += [ |
|
tfarina
2014/04/12 02:40:36
../../third_party/openssl/openssl/crypto/ec/ec_lib
brettw
2014/04/12 04:41:49
Which platform are you compiling on? It worked for
tfarina
2014/04/12 04:48:13
Try building with clang, it works with gcc though.
|
| + # OpenSSL has a few |if ((foo == NULL))| checks. |
| + "-Wno-parentheses-equality", |
| + # OpenSSL uses several function-style macros and then ignores the |
| + # returned value. |
| + "-Wno-unused-value", |
| + ] |
| + } else { |
| + cflags += [ |
| + "-Wno-unused-variable", |
| + ] |
| + } |
| } |