From 5c57b5e3934e3c4fe052f76ce877d23eaa198af8 Mon Sep 17 00:00:00 2001 From: brettw Date: Mon, 11 May 2015 22:36:28 -0700 Subject: [PATCH] Sync defines with the GYP build. BUG= Review URL: https://codereview.chromium.org/1129293003 Cr-Original-Commit-Position: refs/heads/master@{#329357} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 9f7a2cb43a231998f6aaedf7e808562e9a46caaf --- common.gypi | 2 ++ config/BUILD.gn | 16 +++++++++++++--- config/compiler/BUILD.gn | 13 +++++++++++++ config/features.gni | 6 +++++- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/common.gypi b/common.gypi index 5cab2956c..1306666e5 100644 --- a/common.gypi +++ b/common.gypi @@ -2934,6 +2934,8 @@ 'defines': ['ENABLE_AUTOFILL_DIALOG=1'], }], ['enable_prod_wallet_service==1', { + # In GN, this is set on the autofill tagets only. See + # //components/autofill/core/browser:wallet_service 'defines': ['ENABLE_PROD_WALLET_SERVICE=1'], }], ['enable_background==1', { diff --git a/config/BUILD.gn b/config/BUILD.gn index 3857648be..44c87eb70 100644 --- a/config/BUILD.gn +++ b/config/BUILD.gn @@ -42,9 +42,7 @@ declare_args() { # For now we define these globally to match the current GYP build. config("feature_flags") { # TODO(brettw) this probably needs to be parameterized. - defines = [ - "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere. - ] + defines = [ "V8_DEPRECATION_WARNINGS" ] # Don't use deprecated V8 APIs anywhere. if (cld_version > 0) { defines += [ "CLD_VERSION=$cld_version" ] @@ -278,6 +276,18 @@ config("debug") { config("release") { defines = [ "NDEBUG" ] + + # Sanitizers. + # TODO(GYP) The GYP build has "release_valgrind_build == 0" for this + # condition. When Valgrind is set up, we need to do the same here. + if (!is_tsan) { + defines += [ "NVALGRIND" ] + if (!is_nacl) { + # NaCl always enables dynamic annotations. Currently this value is set to + # 1 for all .nexes. + defines += [ "DYNAMIC_ANNOTATIONS_ENABLED=0" ] + } + } } # Default libraries ------------------------------------------------------------ diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn index 9ebb2e7b7..0e28e7da8 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -336,6 +336,7 @@ config("compiler") { "-fno-unwind-tables", "-fno-asynchronous-unwind-tables", ] + defines += [ "NO_UNWIND_TABLES" ] } else { cflags += [ "-funwind-tables" ] } @@ -636,6 +637,18 @@ config("chromium_code") { "__STDC_CONSTANT_MACROS", "__STDC_FORMAT_MACROS", ] + + if (using_sanitizer) { + # _FORTIFY_SOURCE isn't really supported by Clang now, see + # http://llvm.org/bugs/show_bug.cgi?id=16821. + # It seems to work fine with Ubuntu 12 headers though, so use it in + # official builds. + # + # Non-chromium code is not guaranteed to compile cleanly with + # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are + # disabled, so only do that for Release build. + defines += [ "_FORTIFY_SOURCE=2" ] + } } } config("no_chromium_code") { diff --git a/config/features.gni b/config/features.gni index 387345827..74f61cdcd 100644 --- a/config/features.gni +++ b/config/features.gni @@ -51,7 +51,11 @@ declare_args() { enable_media_router = !is_ios && !is_android # Enables proprietary codecs and demuxers; e.g. H264, MOV, AAC, and MP3. - proprietary_codecs = false + # Android OS includes support for proprietary codecs regardless of building + # Chromium or Google Chrome. We also ship Google Chrome and Chromecast with + # proprietary codecs. + # TODO(GYP) The GYP build has || chromecast==1 for this: + proprietary_codecs = is_android || is_chrome_branded enable_configuration_policy = true