diff options
author | Nomis101 <[email protected]> | 2019-08-19 21:38:24 +0200 |
---|---|---|
committer | Bradley Sepos <[email protected]> | 2019-08-21 22:45:32 -0400 |
commit | 30db0a991464d8d63eba64d7699c7c0e140e9ec6 (patch) | |
tree | 157cc64dfccc199463f847576654beeb7d3d000a | |
parent | d6cb1346460fb016df525637ffcc10ff65530d44 (diff) |
make: Add a configure.py option to enable app sandbox.
Currently only implemented for macOS. If it will be implemented on other systems, it can be switched based on the target system, per https://github.com/HandBrake/HandBrake/issues/428#issuecomment-522677832
-rw-r--r-- | macosx/module.defs | 6 | ||||
-rw-r--r-- | make/configure.py | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/macosx/module.defs b/macosx/module.defs index fc6ad9e02..23ba4a824 100644 --- a/macosx/module.defs +++ b/macosx/module.defs @@ -21,7 +21,11 @@ BUILD.out += $(MACOSX.osl.filelist) MACOSX.project = -project $(MACOSX.src/)HandBrake.xcodeproj ## configuration: must be one of { release, debug } -MACOSX.configuration = -configuration $(MACOSX.map.g.$(MACOSX.GCC.g)) +ifeq (1,$(FEATURE.sandbox)) + MACOSX.configuration = -configuration $(MACOSX.map.g.$(MACOSX.GCC.g))-sandbox +else + MACOSX.configuration = -configuration $(MACOSX.map.g.$(MACOSX.GCC.g)) +endif ## mapping from symbolic debug value to xcode configuration MACOSX.map.g.none = release diff --git a/make/configure.py b/make/configure.py index 9e1c70d09..950aa793d 100644 --- a/make/configure.py +++ b/make/configure.py @@ -1361,6 +1361,9 @@ def createCLI( cross = None ): h = IfHost( 'AMD VCE video encoder', '*-*-mingw*', none=argparse.SUPPRESS).value grp.add_argument( '--enable-vce', dest="enable_vce", default=IfHost(True, '*-*-mingw*', none=False).value, action='store_true', help=(( 'enable %s' %h ) if h != argparse.SUPPRESS else h) ) grp.add_argument( '--disable-vce', dest="enable_vce", action='store_false', help=(( 'disable %s' %h ) if h != argparse.SUPPRESS else h) ) + h = IfHost( 'enable the App Sandbox capability (currently macOS-only)', '*-*-darwin*', none=argparse.SUPPRESS).value + grp.add_argument( '--enable-sandbox', dest="enable_sandbox", default=False, action='store_true', help=(( '%s' %h ) if h != argparse.SUPPRESS else h) ) + cli.add_argument_group( grp ) @@ -1666,6 +1669,10 @@ try: # Disable VCE on unsupported platforms options.enable_vce = IfHost(options.enable_vce, '*-*-mingw*', none=False).value + # Sandboxing is currently only implemented on macOS + options.enable_sandbox = IfHost(options.enable_sandbox, '*-*-darwin*', + none=False).value + ######################################### ## OSX specific library and tool checks @@ -1961,6 +1968,7 @@ int main() doc.add( 'FEATURE.vce', int( options.enable_vce )) doc.add( 'FEATURE.x265', int( options.enable_x265 )) doc.add( 'FEATURE.numa', int( options.enable_numa )) + doc.add( 'FEATURE.sandbox', int( options.enable_sandbox )) if build_tuple.match( '*-*-darwin*' ) and options.cross is None: doc.add( 'FEATURE.xcode', int( not (Tools.xcodebuild.fail or options.disable_xcode) )) @@ -2083,6 +2091,8 @@ int main() stdout.write( ' (%s)\n' % note_unsupported ) if not (host_tuple.system == 'linux' or host_tuple.system == 'mingw') else stdout.write( '\n' ) stdout.write( 'Enable VCE: %s' % options.enable_vce ) stdout.write( ' (%s)\n' % note_unsupported ) if not host_tuple.system == 'mingw' else stdout.write( '\n' ) + stdout.write( 'Enable Sandbox: %s' % options.enable_sandbox ) + stdout.write( ' (%s)\n' % note_unsupported ) if not host_tuple.system == 'darwin' else stdout.write( '\n' ) if options.launch: stdout.write( '%s\n' % ('-' * 79) ) |