diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 23:05:41 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 23:05:41 +0000 |
commit | 2bc039a702f3d361e020c7584a5b3f786bee69d4 (patch) | |
tree | e23afbbee83698d30da8876345c701fdc679582c /sandbox/sandbox.gyp | |
parent | 80c36e207822e61b3afb6857eb3f60576f157f16 (diff) | |
download | chromium_src-2bc039a702f3d361e020c7584a5b3f786bee69d4.zip chromium_src-2bc039a702f3d361e020c7584a5b3f786bee69d4.tar.gz chromium_src-2bc039a702f3d361e020c7584a5b3f786bee69d4.tar.bz2 |
seccomp: simplify enable/disable logic
1) Only compile in seccomp code at all if it's on a platform we
intend to support (non-ChromeOS non-ARM non-Views Linux).
2) Move usage of seccomp code behind a define and usage of seccomp
flags into a function call.
The former helps catch bugs in the latter: it will be a link error
if I accidentally break the enable/disable logic in code.
Review URL: http://codereview.chromium.org/7519016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/sandbox.gyp')
-rw-r--r-- | sandbox/sandbox.gyp | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/sandbox/sandbox.gyp b/sandbox/sandbox.gyp index 2166675..89f75fc 100644 --- a/sandbox/sandbox.gyp +++ b/sandbox/sandbox.gyp @@ -132,12 +132,20 @@ ], }, 'conditions': [ - [ 'os_posix == 1 and OS != "mac" and OS != "linux"', { - # GYP requires that each file have at least one target defined. + [ 'OS!="win" and OS!="mac"', { 'targets': [ { 'target_name': 'sandbox', - 'type': 'settings', + 'type': 'static_library', + 'conditions': [ + # Only compile in the seccomp code for the flag combination + # where we support it. + [ 'OS=="linux" and target_arch!="arm" and toolkit_views==0 and selinux==0', { + 'dependencies': [ + '../seccompsandbox/seccomp.gyp:seccomp_sandbox', + ], + }], + ], }, ], }], @@ -161,26 +169,6 @@ '..', ], }, - { - 'target_name': 'sandbox', - 'type': 'static_library', - 'conditions': [ - ['target_arch!="arm"', { - 'dependencies': [ - '../seccompsandbox/seccomp.gyp:seccomp_sandbox', - ]}, - ], - ], - }, - ], - }], - [ 'OS=="linux" and selinux==1', { - # GYP requires that each file have at least one target defined. - 'targets': [ - { - 'target_name': 'sandbox', - 'type': 'settings', - }, ], }], [ 'OS=="win"', { |