Source release v3.5.0
This commit is contained in:
32
build.py
32
build.py
@@ -58,7 +58,7 @@ def GetBuilder(generator):
|
||||
}.get(generator, RunUnknown)
|
||||
|
||||
|
||||
def ImportPlatform(name, gyp_args):
|
||||
def ImportPlatform(name, gyp_args, build_fuzz_tests):
|
||||
"""Handles platform-specific setup for the named platform.
|
||||
|
||||
Computes platform-specific paths, sets gyp arguments for platform-specific
|
||||
@@ -68,6 +68,7 @@ def ImportPlatform(name, gyp_args):
|
||||
Args:
|
||||
name: The name of the platform.
|
||||
gyp_args: An array of gyp arguments to which this function will append.
|
||||
build_fuzz_tests: True when we are building OEMCrypto fuzz tests.
|
||||
|
||||
Returns:
|
||||
The path to the root of the build output.
|
||||
@@ -81,6 +82,10 @@ def ImportPlatform(name, gyp_args):
|
||||
output_path = os.path.join(cdm_top, 'out', name)
|
||||
|
||||
gyp_args.append('--include=%s' % platform_gypi_path)
|
||||
if build_fuzz_tests:
|
||||
fuzzer_settings_path = os.path.join(cdm_top, 'oemcrypto/test/fuzz_tests/platforms/x86-64')
|
||||
fuzzer_settings_gypi_path = os.path.join(fuzzer_settings_path, 'fuzzer_settings.gypi')
|
||||
gyp_args.append('--include=%s' % fuzzer_settings_gypi_path)
|
||||
gyp_args.append('-Goutput_dir=%s' % output_path)
|
||||
|
||||
platform_environment_path = os.path.join(target_path, 'environment.py')
|
||||
@@ -97,8 +102,10 @@ def ImportPlatform(name, gyp_args):
|
||||
|
||||
def main(args):
|
||||
if IsNinjaInstalled():
|
||||
print "ninja is installed - use ninja for generator."
|
||||
default_generator = 'ninja'
|
||||
else:
|
||||
print "ninja is not installed - use make for generator."
|
||||
default_generator = 'make'
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
@@ -118,19 +125,26 @@ def main(args):
|
||||
'Defaults to ninja when available, make otherwise.')
|
||||
parser.add_argument('-D', action='append', default=[],
|
||||
help='Pass variable definitions to gyp.')
|
||||
parser.add_argument('--disable_cpp_11', dest='D', const='disable_cpp_11=1',
|
||||
action='append_const',
|
||||
help='Compile without support for C++11.')
|
||||
parser.add_argument('-ft', '--fuzz_tests', default=False,
|
||||
action='store_true',
|
||||
help='Set this flag if you want to build fuzz tests.')
|
||||
|
||||
options = parser.parse_args(args)
|
||||
|
||||
gyp_args = [
|
||||
'--format=%s' % options.generator,
|
||||
'--depth=%s' % cdm_top,
|
||||
'%s/cdm/cdm_unittests.gyp' % cdm_top,
|
||||
] + [ '-D' + var for var in options.D ]
|
||||
'--format=%s' % options.generator,
|
||||
'--depth=%s' % cdm_top,
|
||||
]
|
||||
if options.fuzz_tests:
|
||||
gyp_args.append(
|
||||
'%s/oemcrypto/test/fuzz_tests/oemcrypto_fuzztests.gyp' % cdm_top)
|
||||
else:
|
||||
gyp_args.append('%s/cdm/cdm_unittests.gyp' % cdm_top)
|
||||
for var in options.D:
|
||||
gyp_args.append('-D' + var)
|
||||
|
||||
output_path = ImportPlatform(options.platform, gyp_args)
|
||||
output_path = ImportPlatform(
|
||||
options.platform, gyp_args, options.fuzz_tests)
|
||||
|
||||
print ' Running: %s' % (['gyp'] + gyp_args)
|
||||
retval = gyp.main(gyp_args)
|
||||
|
||||
Reference in New Issue
Block a user