diff options
author | Jack Lloyd <[email protected]> | 2021-10-28 17:35:22 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2021-10-28 17:50:50 -0400 |
commit | 4e1d1fa9cc0c1066cddbc312bd8c81c9a512176f (patch) | |
tree | 3ae09ad9d69c8c8bcb182cdfdaa4b1098717b0ba /src/scripts/ci_build.py | |
parent | 81e33dd31169fab2354c1ca45d59dd43a841a6bc (diff) |
Add amalgamation CI build (GH #2836)
Also add better error checking to ci_build script
Remove some options that were parsed but ignored
Diffstat (limited to 'src/scripts/ci_build.py')
-rwxr-xr-x | src/scripts/ci_build.py | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py index 9e99f2d1a..fd7313023 100755 --- a/src/scripts/ci_build.py +++ b/src/scripts/ci_build.py @@ -25,6 +25,33 @@ def get_concurrency(): except ImportError: return def_concurrency +def known_targets(): + return [ + 'amalgamation', + 'baremetal', + 'bsi', + 'coverage', + 'cross-android-arm32', + 'cross-android-arm64', + 'cross-arm32', + 'cross-arm64', + 'cross-i386', + 'cross-ios-arm64', + 'cross-mips64', + 'cross-ppc32', + 'cross-ppc64', + 'cross-win64', + 'docs', + 'fuzzers', + 'lint', + 'minimized', + 'nist', + 'sanitizer', + 'shared', + 'static', + 'valgrind', + ] + def build_targets(target, target_os): if target in ['shared', 'minimized', 'bsi', 'nist']: yield 'shared' @@ -98,6 +125,9 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, if target in ['minimized']: flags += ['--minimized-build', '--enable-modules=system_rng,sha2_32,sha2_64,aes'] + if target in ['amalgamation']: + flags += ['--amalgamation'] + if target in ['bsi', 'nist']: # tls is optional for bsi/nist but add it so verify tests work with these minimized configs flags += ['--module-policy=%s' % (target), '--enable-modules=tls'] @@ -344,6 +374,8 @@ def parse_args(args): parser.add_option('--os', default=default_os(), help='Set the target os (default %default)') + parser.add_option('--cpu', default=None, + help='Specify a target CPU platform') parser.add_option('--cc', default='gcc', help='Set the target compiler type (default %default)') parser.add_option('--cc-bin', default=None, @@ -357,21 +389,9 @@ def parse_args(args): parser.add_option('--extra-cxxflags', metavar='FLAGS', default=[], action='append', help='Specify extra build flags') - parser.add_option('--cpu', default=None, - help='Specify a target CPU platform') - - parser.add_option('--with-debug', action='store_true', default=False, - help='Include debug information') - parser.add_option('--amalgamation', action='store_true', default=False, - help='Build via amalgamation') - parser.add_option('--disable-shared', action='store_true', default=False, - help='Disable building shared libraries') parser.add_option('--disabled-tests', metavar='DISABLED_TESTS', default=[], action='append', help='Comma separated list of tests that should not be run') - parser.add_option('--branch', metavar='B', default=None, - help='Specify branch being built') - parser.add_option('--dry-run', action='store_true', default=False, help='Just show commands to be executed') parser.add_option('--build-jobs', metavar='J', default=get_concurrency(), @@ -423,6 +443,7 @@ def main(args=None): if args is None: args = sys.argv + print("Invoked as '%s'" % (' '.join(args))) (options, args) = parse_args(args) @@ -432,6 +453,10 @@ def main(args=None): target = args[1] + if target not in known_targets(): + print("Unknown target '%s'" % (target)) + return 2 + if options.use_python3 is None: use_python3 = have_prog('python3') else: @@ -513,6 +538,7 @@ def main(args=None): make_cmd += ['-C', root_dir] if options.build_jobs > 1 and options.make_tool != 'nmake': make_cmd += ['-j%d' % (options.build_jobs)] + make_cmd += ['-k'] if target == 'docs': |