Merge pull request #4 from akien-mga/make-jobs

Add option to specify make build jobs (--jobs)
This commit is contained in:
Rémi Verschelde 2020-02-24 16:00:45 +01:00 committed by GitHub
commit 7e094b5f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 4 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
__pycache__/
*.pyc

View File

@ -455,7 +455,7 @@ def make(opts: AndroidOpts, product: str, target: str):
build_dir = path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration)) build_dir = path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration))
make_args = ['-C', build_dir] make_args = ['-j', opts.jobs, '-C', build_dir]
make_args += ['V=1'] if opts.verbose_make else [] make_args += ['V=1'] if opts.verbose_make else []
run_command('make', args=make_args, name='make') run_command('make', args=make_args, name='make')

2
bcl.py
View File

@ -62,7 +62,7 @@ def make_bcl(opts: BclOpts):
build_dir = path_join(opts.configure_dir, 'bcl') build_dir = path_join(opts.configure_dir, 'bcl')
make_args = ['-C', build_dir, '-C', 'mono'] make_args = ['-j', opts.jobs, '-C', build_dir, '-C', 'mono']
make_args += ['V=1'] if opts.verbose_make else [] make_args += ['V=1'] if opts.verbose_make else []
run_command('make', args=make_args, name='make bcl') run_command('make', args=make_args, name='make bcl')

View File

@ -44,6 +44,7 @@ def add_base_arguments(parser, default_help):
mono_sources_default = os.environ.get('MONO_SOURCE_ROOT', '') mono_sources_default = os.environ.get('MONO_SOURCE_ROOT', '')
parser.add_argument('--verbose-make', action='store_true', default=False, help=default_help) parser.add_argument('--verbose-make', action='store_true', default=False, help=default_help)
parser.add_argument('--jobs', default='1', help=default_help)
parser.add_argument('--configure-dir', default=path_join(home, 'mono-configs'), help=default_help) parser.add_argument('--configure-dir', default=path_join(home, 'mono-configs'), help=default_help)
parser.add_argument('--install-dir', default=path_join(home, 'mono-installs'), help=default_help) parser.add_argument('--install-dir', default=path_join(home, 'mono-installs'), help=default_help)

View File

@ -167,7 +167,7 @@ def configure(opts: DesktopOpts, product: str, target_platform: str, target: str
def make(opts: DesktopOpts, product: str, target_platform: str, target: str): def make(opts: DesktopOpts, product: str, target_platform: str, target: str):
build_dir = path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration)) build_dir = path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration))
make_args = ['-C', build_dir] make_args = ['-j', opts.jobs, '-C', build_dir]
make_args += ['V=1'] if opts.verbose_make else [] make_args += ['V=1'] if opts.verbose_make else []
run_command('make', args=make_args, name='make') run_command('make', args=make_args, name='make')

View File

@ -64,6 +64,7 @@ def make(opts: BaseOpts, target: str):
CMAKE_ARGS += [os.environ.get('llvm-%s_CMAKE_ARGS' % target, '')] CMAKE_ARGS += [os.environ.get('llvm-%s_CMAKE_ARGS' % target, '')]
make_args = [ make_args = [
'-j', opts.jobs,
'-C', '%s/llvm' % opts.mono_source_root, '-C', '%s/llvm' % opts.mono_source_root,
'-f', 'build.mk', 'install-llvm', '-f', 'build.mk', 'install-llvm',
'LLVM_BUILD=%s' % build_dir, 'LLVM_BUILD=%s' % build_dir,

View File

@ -6,6 +6,7 @@ from os.path import abspath
@dataclass @dataclass
class BaseOpts: class BaseOpts:
verbose_make: bool verbose_make: bool
jobs: str
configure_dir: str configure_dir: str
install_dir: str install_dir: str
mono_source_root: str mono_source_root: str
@ -49,6 +50,7 @@ def base_opts_from_args(args):
from os.path import abspath from os.path import abspath
return BaseOpts( return BaseOpts(
verbose_make = args.verbose_make, verbose_make = args.verbose_make,
jobs = args.jobs,
configure_dir = abspath(args.configure_dir), configure_dir = abspath(args.configure_dir),
install_dir = abspath(args.install_dir), install_dir = abspath(args.install_dir),
mono_source_root = abspath(args.mono_sources), mono_source_root = abspath(args.mono_sources),

View File

@ -128,7 +128,7 @@ def make(opts: RuntimeOpts, product: str, target: str):
build_dir = path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration)) build_dir = path_join(opts.configure_dir, '%s-%s-%s' % (product, target, opts.configuration))
install_dir = path_join(opts.install_dir, '%s-%s-%s' % (product, target, opts.configuration)) install_dir = path_join(opts.install_dir, '%s-%s-%s' % (product, target, opts.configuration))
make_args = ['-C', build_dir] make_args = ['-j', opts.jobs, '-C', build_dir]
make_args += ['V=1'] if opts.verbose_make else [] make_args += ['V=1'] if opts.verbose_make else []
make_env = os.environ.copy() make_env = os.environ.copy()