diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 04:55:13 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 04:55:13 +0000 |
commit | a5c59815b4d3169562ffae7928cd9a664d6b0052 (patch) | |
tree | b0176f6388782bb81ead31e8a470b055b51e7c81 /build | |
parent | 89307897057aa94aaabae16d4f5bd28a659de769 (diff) | |
download | chromium_src-a5c59815b4d3169562ffae7928cd9a664d6b0052.zip chromium_src-a5c59815b4d3169562ffae7928cd9a664d6b0052.tar.gz chromium_src-a5c59815b4d3169562ffae7928cd9a664d6b0052.tar.bz2 |
build/common.gypi: split out filename exclude rules
Here's a step towards making this enormous file a little more tractable.
Review URL: http://codereview.chromium.org/9288078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119372 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/common.gypi | 73 | ||||
-rw-r--r-- | build/filename_rules.gypi | 86 |
2 files changed, 90 insertions, 69 deletions
diff --git a/build/common.gypi b/build/common.gypi index e779f01..64b60b9 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -1323,65 +1323,17 @@ }], ], }, { + 'includes': [ + # Rules for excluding e.g. foo_win.cc from the build on non-Windows. + 'filename_rules.gypi', + ], # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the # C99 macros on Mac and Linux. 'defines': [ '__STDC_FORMAT_MACROS', ], 'conditions': [ - ['OS!="win"', { - 'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)win/'], - ['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ], - }], - ['OS!="mac"', { - 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)(cocoa|mac)/'], - ['exclude', '\\.mm?$' ] ], - }], - ['use_x11!=1', { - 'sources/': [ - ['exclude', '_(chromeos|x|x11)(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'], - ], - }], - ['toolkit_uses_gtk!=1', { - 'sources/': [ - ['exclude', '_gtk(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)gtk/'], - ['exclude', '(^|/)gtk_[^/]*\\.(h|cc)$'], - ], - }], - ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { - 'sources/': [ - ['exclude', '_xdg(_unittest)?\\.(h|cc)$'], - ], - }], - ['use_wayland!=1', { - 'sources/': [ - ['exclude', '_(wayland)(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)wayland/'], - ['exclude', '(^|/)(wayland)_[^/]*\\.(h|cc)$'], - ], - }], - # Do not exclude the linux files on *BSD since most of them can be - # shared at this point. - # In case a file is not needed, it is going to be excluded later on. - ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { - 'sources/': [ - ['exclude', '_linux(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)linux/'], - ], - }], - ['OS!="android"', { - 'sources/': [ - ['exclude', '_android(_unittest)?\\.cc$'], - ['exclude', '(^|/)android/'], - ], - }], - # We use "POSIX" to refer to all non-Windows operating systems. ['OS=="win"', { - 'sources/': [ ['exclude', '_posix(_unittest)?\\.(h|cc)$'] ], # turn on warnings for signed/unsigned mismatch on chromium code. 'msvs_settings': { 'VCCLCompilerTool': { @@ -1394,23 +1346,6 @@ 4251, # class 'std::xx' needs to have dll-interface. ], }], - ['chromeos!=1', { - 'sources/': [ ['exclude', '_chromeos\\.(h|cc)$'] ] - }], - ['toolkit_views==0', { - 'sources/': [ ['exclude', '_views\\.(h|cc)$'] ] - }], - ['use_aura==0', { - 'sources/': [ ['exclude', '_aura(_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)aura/'], - ] - }], - ['use_aura==0 or use_x11==0', { - 'sources/': [ ['exclude', '_aurax11\\.(h|cc)$'] ] - }], - ['use_aura==0 or OS!="win"', { - 'sources/': [ ['exclude', '_aurawin\\.(h|cc)$'] ] - }], ], }], ], # target_conditions for 'target_defaults' diff --git a/build/filename_rules.gypi b/build/filename_rules.gypi new file mode 100644 index 0000000..6a27107 --- /dev/null +++ b/build/filename_rules.gypi @@ -0,0 +1,86 @@ +# Copyright (c) 2012 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. + +# This gypi file defines the patterns used for determining whether a +# file is excluded from the build on a given platform. It is +# included by common.gypi for chromium_code. + +{ + 'conditions': [ + ['OS!="win"', { + 'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)win/'], + ['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ], + }], + ['OS!="mac"', { + 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)(cocoa|mac)/'], + ['exclude', '\\.mm?$' ] ], + }], + # Do not exclude the linux files on *BSD since most of them can be + # shared at this point. + # In case a file is not needed, it is going to be excluded later on. + # TODO(evan): the above is not correct; we shouldn't build _linux + # files on non-linux. + ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { + 'sources/': [ + ['exclude', '_linux(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)linux/'], + ], + }], + ['OS!="android"', { + 'sources/': [ + ['exclude', '_android(_unittest)?\\.cc$'], + ['exclude', '(^|/)android/'], + ], + }], + ['OS=="win"', { + 'sources/': [ ['exclude', '_posix(_unittest)?\\.(h|cc)$'] ], + }], + ['chromeos!=1', { + 'sources/': [ ['exclude', '_chromeos\\.(h|cc)$'] ] + }], + ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { + 'sources/': [ + ['exclude', '_xdg(_unittest)?\\.(h|cc)$'], + ], + }], + + + ['use_x11!=1', { + 'sources/': [ + ['exclude', '_(chromeos|x|x11)(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'], + ], + }], + ['toolkit_uses_gtk!=1', { + 'sources/': [ + ['exclude', '_gtk(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)gtk/'], + ['exclude', '(^|/)gtk_[^/]*\\.(h|cc)$'], + ], + }], + ['toolkit_views==0', { + 'sources/': [ ['exclude', '_views\\.(h|cc)$'] ] + }], + ['use_aura==0', { + 'sources/': [ ['exclude', '_aura(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)aura/'], + ] + }], + ['use_aura==0 or use_x11==0', { + 'sources/': [ ['exclude', '_aurax11\\.(h|cc)$'] ] + }], + ['use_aura==0 or OS!="win"', { + 'sources/': [ ['exclude', '_aurawin\\.(h|cc)$'] ] + }], + ['use_wayland!=1', { + 'sources/': [ + ['exclude', '_(wayland)(_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)wayland/'], + ['exclude', '(^|/)(wayland)_[^/]*\\.(h|cc)$'], + ], + }], + ] +} |