From 2fb7ab55302783d7b2def2369cdc794443033fa3 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Fri, 28 Jun 2013 15:22:46 +0000 Subject: [PATCH] Introduce a notion of "v8_code" in gyp config files. This allows for compiling third-party code (such as ICU) with less strict flags. BUG=v8:2745 R=jkummerow@chromium.org Review URL: https://codereview.chromium.org/18181006 Patch from Jochen Eisinger . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- build/standalone.gypi | 38 ++++++++++++++++++++++++++++++++++++++ preparser/preparser.gyp | 3 +++ samples/samples.gyp | 3 +++ src/d8.gyp | 3 ++- src/third_party/vtune/v8vtune.gyp | 3 +++ test/cctest/cctest.gyp | 3 ++- tools/gyp/v8.gyp | 3 +++ 7 files changed, 54 insertions(+), 2 deletions(-) diff --git a/build/standalone.gypi b/build/standalone.gypi index f7ca0a6..8373bc9 100644 --- a/build/standalone.gypi +++ b/build/standalone.gypi @@ -65,6 +65,13 @@ 'target_arch%': '<(target_arch)', 'v8_target_arch%': '<(v8_target_arch)', 'werror%': '-Werror', + + # .gyp files or targets should set v8_code to 1 if they build V8 specific + # code, as opposed to external code. This variable is used to control such + # things as the set of warnings to enable, and whether warnings are treated + # as errors. + 'v8_code%': 0, + 'conditions': [ ['(v8_target_arch=="arm" and host_arch!="arm") or \ (v8_target_arch=="mipsel" and host_arch!="mipsel") or \ @@ -74,6 +81,11 @@ }, { 'want_separate_host_toolset': 0, }], + ['OS == "win"', { + 'os_posix%': 0, + }, { + 'os_posix%': 1, + }], ], # Default ARM variable settings. 'armv7%': 'default', @@ -83,6 +95,9 @@ 'arm_thumb': 'default', }, 'target_defaults': { + 'variables': { + 'v8_code%': '<(v8_code)', + }, 'default_configuration': 'Debug', 'configurations': { 'Debug': { @@ -92,6 +107,29 @@ # Xcode insists on this empty entry. }, }, + 'target_conditions': [ + ['v8_code == 0', { + 'conditions': [ + ['os_posix == 1 and OS != "mac"', { + 'cflags!': [ + '-Werror', + ], + }], + ['OS == "mac"', { + 'xcode_settings': { + 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror + }, + }], + ['OS == "win"', { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'false', + }, + }, + }], + ], + }], + ], }, 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ diff --git a/preparser/preparser.gyp b/preparser/preparser.gyp index 863a2ff..598f0a5 100644 --- a/preparser/preparser.gyp +++ b/preparser/preparser.gyp @@ -26,6 +26,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { + 'variables': { + 'v8_code': 1, + }, 'includes': ['../build/common.gypi'], 'targets': [ { diff --git a/samples/samples.gyp b/samples/samples.gyp index 3c720a7..8b1de7e 100644 --- a/samples/samples.gyp +++ b/samples/samples.gyp @@ -26,6 +26,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { + 'variables': { + 'v8_code': 1, + }, 'includes': ['../build/common.gypi'], 'target_defaults': { 'type': 'executable', diff --git a/src/d8.gyp b/src/d8.gyp index ea043dc..47a7cc0 100644 --- a/src/d8.gyp +++ b/src/d8.gyp @@ -26,12 +26,13 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { - 'includes': ['../build/common.gypi'], 'variables': { + 'v8_code': 1, 'console%': '', # Enable support for Intel VTune. Supported on ia32/x64 only 'v8_enable_vtunejit%': 0, }, + 'includes': ['../build/common.gypi'], 'targets': [ { 'target_name': 'd8', diff --git a/src/third_party/vtune/v8vtune.gyp b/src/third_party/vtune/v8vtune.gyp index cabd37a..6c3de3e 100644 --- a/src/third_party/vtune/v8vtune.gyp +++ b/src/third_party/vtune/v8vtune.gyp @@ -26,6 +26,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { + 'variables': { + 'v8_code': 1, + }, 'includes': ['../../../build/common.gypi'], 'targets': [ { diff --git a/test/cctest/cctest.gyp b/test/cctest/cctest.gyp index 0811093..a65de86 100644 --- a/test/cctest/cctest.gyp +++ b/test/cctest/cctest.gyp @@ -26,10 +26,11 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { - 'includes': ['../../build/common.gypi'], 'variables': { + 'v8_code': 1, 'generated_file': '<(SHARED_INTERMEDIATE_DIR)/resources.cc', }, + 'includes': ['../../build/common.gypi'], 'targets': [ { 'target_name': 'cctest', diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index 34b1faf..84b0748 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -26,6 +26,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { + 'variables': { + 'v8_code': 1, + }, 'includes': ['../../build/common.gypi'], 'targets': [ { -- 2.7.4