diff options
author | brettw@chromium.org <brettw@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c> | 2014-04-11 17:58:26 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c> | 2014-04-11 17:58:26 +0000 |
commit | eebc9e92e7c32760570bfcb4f55eb1130c967aeb (patch) | |
tree | 70834de526e2cc7c5093f2669e8dc8ce5bebd92a /BUILD.gn | |
parent | 5ed803d0c301ad9b494126522e2e24430a99a955 (diff) | |
download | openssl-eebc9e92e7c32760570bfcb4f55eb1130c967aeb.tar.gz |
Add GN build file for OpenSSL.
This sluprs in the existing .gypi file to more easily keep the builds in sync.
TBR=rsleevi@chromium.org
Review URL: https://codereview.chromium.org/234833005
git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/openssl@263283 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Diffstat (limited to 'BUILD.gn')
-rw-r--r-- | BUILD.gn | 93 |
1 files changed, 91 insertions, 2 deletions
@@ -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. +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 += [ + # 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", + ] + } } |