Index: pylib/gyp/__init__.py |
diff --git a/pylib/gyp/__init__.py b/pylib/gyp/__init__.py |
index 3769c526522e98b52b7139c0fb22e5881a22a69a..9ed19a8c48275df14102df89e8c89452927cbfd5 100755 |
--- a/pylib/gyp/__init__.py |
+++ b/pylib/gyp/__init__.py |
@@ -69,6 +69,10 @@ def Load(build_files, format, default_variables={}, |
# named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, |
# avoiding collisions with user and automatic variables. |
default_variables['GENERATOR'] = format |
+ default_variables['HOST_OS'] = options.host_os |
+ default_variables['TARGET_OS'] = options.target_os |
Torne
2013/03/11 16:16:50
Currently there is a variable OS that's set by som
|
+ default_variables['HOST_ARCH'] = options.host_arch |
+ default_variables['TARGET_ARCH'] = options.target_arch |
Nico
2013/07/05 21:50:50
On Mac (and iOS), targets can have multiple target
|
# Format can be a custom python file, or by default the name of a module |
# within gyp.generator. |
@@ -333,6 +337,18 @@ def gyp_main(args): |
parser.add_option('--no-circular-check', dest='circular_check', |
action='store_false', default=True, regenerate=False, |
help="don't check for circular relationships between files") |
+ parser.add_option('--host-os', dest='host_os', action='store', default=None, |
+ metavar='OS', env_name='GYP_HOST_OS', |
+ help='override detected host OS') |
+ parser.add_option('--target-os', dest='target_os', action='store', |
+ default=None, metavar='OS', env_name='GYP_TARGET_OS', |
+ help='crosscompile for a different target OS') |
+ parser.add_option('--host-arch', dest='host_arch', action='store', |
+ default=None, metavar='ARCH', env_name='GYP_HOST_ARCH', |
+ help='override detected host architecture') |
+ parser.add_option('--target-arch', dest='target_arch', action='store', |
+ default=None, metavar='ARCH', env_name='GYP_TARGET_ARCH', |
+ help='crosscompile for a different target architecture') |
# We read a few things from ~/.gyp, so set up a var for that. |
home_vars = ['HOME'] |
@@ -381,6 +397,30 @@ def gyp_main(args): |
p = os.environ.get('GYP_PARALLEL') |
options.parallel = bool(p and p != '0') |
+ if not options.host_os: |
+ if options.use_environment: |
+ options.host_os = os.environ.get('GYP_HOST_OS') |
+ if not options.host_os: |
+ options.host_os = gyp.common.GetFlavor({}) |
+ |
+ if not options.target_os: |
+ if options.use_environment: |
+ options.target_os = os.environ.get('GYP_TARGET_OS') |
+ if not options.target_os: |
+ options.target_os = options.host_os |
+ |
+ if not options.host_arch: |
+ if options.use_environment: |
+ options.host_arch = os.environ.get('GYP_HOST_ARCH') |
+ if not options.host_arch: |
+ options.host_arch = gyp.common.DetectHostArchitecture() |
+ |
+ if not options.target_arch: |
+ if options.use_environment: |
+ options.target_arch = arch.environ.get('GYP_TARGET_ARCH') |
+ if not options.target_arch: |
+ options.target_arch = options.host_arch |
+ |
for mode in options.debug: |
gyp.debug[mode] = 1 |