summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-26 00:15:50 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-26 00:15:50 +0000
commit4ebb4f136e3e5040351b4e29ca79fe1153ce606d (patch)
treedec0297e2f41b55c7a93ab586f0f60f9ca6f1d60
parentd3af5134167cbdad1d2a647cd2a0ffe428a7cb8e (diff)
downloadchromium_src-4ebb4f136e3e5040351b4e29ca79fe1153ce606d.zip
chromium_src-4ebb4f136e3e5040351b4e29ca79fe1153ce606d.tar.gz
chromium_src-4ebb4f136e3e5040351b4e29ca79fe1153ce606d.tar.bz2
Refactor OS-dependent filename exclusion patterns
Rather than duplicate logic in the tree, merge all of the shared rules about patterns in filenames into one common set. The pattern is: "if (OS != x): exclude x's files." This is especially needed for upcoming changes that bring in a few more platform-specific (FreeBSD, OpenBSD, Solaris(?)) files. Review URL: http://codereview.chromium.org/443011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33160 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--app/app.gyp27
-rw-r--r--base/base.gyp35
-rw-r--r--build/common.gypi34
-rwxr-xr-xchrome/chrome.gyp30
4 files changed, 34 insertions, 92 deletions
diff --git a/app/app.gyp b/app/app.gyp
index fbc9e2d..78f9978 100644
--- a/app/app.gyp
+++ b/app/app.gyp
@@ -15,33 +15,6 @@
'resources/app_strings.grd',
],
},
- 'target_defaults': {
- 'sources/': [
- ['exclude', '/(cocoa|gtk|win)/'],
- ['exclude', '_(cocoa|gtk|linux|mac|posix|skia|win|x)\\.(cc|mm?)$'],
- ['exclude', '/(gtk|win|x11)_[^/]*\\.cc$'],
- ],
- 'conditions': [
- ['OS=="linux"', {'sources/': [
- ['include', '/gtk/'],
- ['include', '_(gtk|linux|posix|skia|x)\\.cc$'],
- ['include', '/(gtk|x11)_[^/]*\\.cc$'],
- ]}],
- ['OS=="mac"', {'sources/': [
- ['include', '/cocoa/'],
- ['include', '_(cocoa|mac|posix)\\.(cc|mm?)$'],
- ]}, { # else: OS != "mac"
- 'sources/': [
- ['exclude', '\\.mm?$'],
- ],
- }],
- ['OS=="win"', {'sources/': [
- ['include', '_(win)\\.cc$'],
- ['include', '/win/'],
- ['include', '/win_[^/]*\\.cc$'],
- ]}],
- ],
- },
'targets': [
{
'target_name': 'app_base',
diff --git a/base/base.gyp b/base/base.gyp
index cce3f07..49a6773 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -398,8 +398,6 @@
],
'conditions': [
[ 'OS == "linux" or OS == "freebsd"', {
- 'sources/': [ ['exclude', '_(mac|win|chromeos)\\.cc$'],
- ['exclude', '\\.mm?$' ] ],
'conditions': [
[ 'chromeos==1 or toolkit_views==1', {
'sources/': [ ['include', '_chromeos\\.cc$'] ]
@@ -438,15 +436,12 @@
{ # else: OS != "linux" && OS != "freebsd"
'sources/': [
['exclude', '/xdg_mime/'],
+ ['exclude', '_nss\.cc$'],
],
'sources!': [
- 'crypto/rsa_private_key_nss.cc',
- 'crypto/signature_creator_nss.cc',
- 'crypto/signature_verifier_nss.cc',
'atomicops_internals_x86_gcc.cc',
'base_paths_posix.cc',
'directory_watcher_inotify.cc',
- 'hmac_nss.cc',
'linux_util.cc',
'message_pump_glib.cc',
'nss_init.cc',
@@ -494,9 +489,6 @@
},
],
[ 'OS == "mac"', {
- 'sources/': [ ['exclude', '_(linux|gtk|win|chromeos)\\.cc$'] ],
- 'sources!': [
- ],
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
@@ -519,8 +511,6 @@
'include_dirs': [
'../chrome/third_party/wtl/include',
],
- 'sources/': [ ['exclude', '_(linux|gtk|mac|posix|chromeos)\\.cc$'],
- ['exclude', '\\.mm?$' ] ],
'sources!': [
'data_pack.cc',
'event_recorder_stubs.cc',
@@ -699,7 +689,6 @@
],
'conditions': [
['OS == "linux" or OS == "freebsd"', {
- 'sources/': [ ['exclude', '\\.mm?$' ] ],
'sources!': [
'file_version_info_unittest.cc',
'worker_pool_linux_unittest.cc',
@@ -763,28 +752,6 @@
'test/test_file_util_posix.cc',
'test/test_file_util_win.cc',
],
- 'conditions': [
- [ 'OS == "linux" or OS == "freebsd"', {
- 'sources/': [ ['exclude', '_(mac|win|chromeos)\\.cc$'],
- ['exclude', '\\.mm?$' ] ],
- 'conditions': [
- [ 'chromeos==1 or toolkit_views==1', {
- 'sources/': [ ['include', '_chromeos\\.cc$'] ]
- },
- ],
- ],
- },
- ],
- [ 'OS == "mac"', {
- 'sources/': [ ['exclude', '_(linux|win|chromeos)\\.cc$'] ],
- },
- ],
- [ 'OS == "win"', {
- 'sources/': [ ['exclude', '_(linux|mac|posix|chromeos)\\.cc$'],
- ['exclude', '\\.mm?$' ] ],
- },
- ],
- ],
},
{
'target_name': 'test_support_perf',
diff --git a/build/common.gypi b/build/common.gypi
index e6906fc..41dd4a4 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -908,7 +908,7 @@
},
}],
['chromium_code==0', {
- # This section must follow the other conditon sections above because
+ # This section must follow the other condition sections above because
# external_code.gypi expects to be merged into those settings.
'includes': [
'external_code.gypi',
@@ -920,6 +920,38 @@
'defines': [
'__STDC_FORMAT_MACROS',
],
+ 'conditions': [
+ ['OS!="win"', {
+ 'sources/': [ ['exclude', '_win\\.cc$'],
+ ['exclude', '/win/'],
+ ['exclude', '/win_[^/]*\\.cc$'] ],
+ }],
+ ['OS!="mac"', {
+ 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'],
+ ['exclude', '\.mm$' ] ],
+ }],
+ ['OS!="linux"', {
+ 'sources/': [
+ ['exclude', '_(chromeos|gtk|linux|x|x11)(_unittest)?\\.cc$'],
+ ['exclude', '/gtk/'],
+ ['exclude', '/(gtk|x11)_[^/]*\\.cc$'] ],
+ }],
+ # We use "POSIX" to refer to all non-Windows operating systems.
+ ['OS=="win"', {
+ 'sources/': [ ['exclude', '_posix\\.cc$'] ],
+ }],
+ # Though Skia is conceptually shared by Linux and Windows,
+ # the only _skia files in our tree are Linux-specific.
+ ['OS!="linux"', {
+ 'sources/': [ ['exclude', '_skia\\.cc$'] ],
+ }],
+ ['chromeos!=1', {
+ 'sources/': [ ['exclude', '_chromeos\\.cc$'] ]
+ }],
+ ['OS!="win" and toolkit_views!=1', {
+ 'sources/': [ ['exclude', '_views\\.cc$'] ]
+ }],
+ ],
},
}],
['disable_nacl==1', {
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index b2ab988..e3cc815 100755
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -190,36 +190,6 @@
}],
], # conditions
}, # variables
- 'target_defaults': {
- 'sources/': [
- ['exclude', '/(cocoa|gtk|win)/'],
- ['exclude', '_(cocoa|gtk|linux|mac|posix|skia|win|views|x)(_unittest)?(_mac)?\\.(cc|mm?)$'],
- ['exclude', '/(gtk|win|x11)_[^/]*\\.cc$'],
- ],
- 'conditions': [
- ['OS=="linux" or OS=="freebsd"', {'sources/': [
- ['include', '/gtk/'],
- ['include', '_(gtk|linux|posix|skia|x)(_unittest)?\\.cc$'],
- ['include', '/(gtk|x11)_[^/]*\\.cc$'],
- ]}],
- ['OS=="mac"', {'sources/': [
- ['include', '/cocoa/'],
- ['include', '_(cocoa|mac|posix)(_unittest)?(_mac)?\\.(cc|mm?)$'],
- ]}, { # else: OS != "mac"
- 'sources/': [
- ['exclude', '\\.mm?$'],
- ],
- }],
- ['OS=="win"', {'sources/': [
- ['include', '_(views|win)(_unittest)?\\.cc$'],
- ['include', '/win/'],
- ['include', '/(views|win)_[^/]*\\.cc$'],
- ]}],
- ['OS=="linux" and toolkit_views==1', {'sources/': [
- ['include', '_views\\.cc$'],
- ]}],
- ],
- },
'targets': [
{
# TODO(mark): It would be better if each static library that needed