diff options
Diffstat (limited to 'scripts/llvm.py')
-rw-r--r-- | scripts/llvm.py | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/scripts/llvm.py b/scripts/llvm.py index 919caf9..d1bf29d 100644 --- a/scripts/llvm.py +++ b/scripts/llvm.py @@ -30,11 +30,6 @@ def die(message, config_to_dump=None): exit(1) -def get_worktree_root(env): - """Get the path to the LLVM worktree corresponding to env.""" - return os.path.join(env, "llvm") - - def dump_config(config): """Dump the list of projects that are enabled in the given config.""" @@ -52,7 +47,7 @@ def projects(args): proj = Proj() - llvm_worktree_root = get_worktree_root(args.env) + llvm_worktree_root = args.sources llvm_repos_root = args.repos config = LLVMSourceConfig(proj, llvm_worktree_root) @@ -80,7 +75,7 @@ def push_current_branch(args): proj = Proj() - llvm_worktree_root = get_worktree_root(args.env) + llvm_worktree_root = args.sources config = LLVMSourceConfig(proj, llvm_worktree_root) llvm_worktree = Clone(proj, llvm_worktree_root) @@ -100,7 +95,7 @@ def configure_build(args): proj = Proj() - llvm_worktree_root = get_worktree_root(args.env) + llvm_worktree_root = args.sources sourceConfig = LLVMSourceConfig(proj, llvm_worktree_root) buildConfig = LLVMBuildConfig(sourceConfig, args.build) @@ -130,11 +125,6 @@ def configure_build(args): valid_subprojects = list(LLVMSubproject.get_all_subprojects().keys()) options = ArgumentParser(formatter_class=RawTextHelpFormatter) -options.add_argument( - '--env', - required=True, - help="Path to the environment to update.") - subcommands = options.add_subparsers(dest="subcommand") # Subcommand for adding / removing subprojects @@ -169,6 +159,12 @@ projs.add_argument( '--repos', help="Path to the directory containing the repositories for all LLVM " "subprojects.") +projs.add_argument( + '--source-dir', + dest='sources', + required=True, + help="Path to the directory containing the LLVM worktree that we're adding " + "or removing subprojects from.") # Subcommand for pushing the current branch to origin push = subcommands.add_parser( @@ -176,12 +172,22 @@ push = subcommands.add_parser( help="Push current branch to origin linaro-local/<user>/<branch>, " "for all enabled subprojects.") push.set_defaults(run_command=push_current_branch) +push.add_argument( + '--source-dir', + dest='sources', + required=True, + help="Path to the directory containing the LLVM worktree.") # Subcommand for configuring a build directory configure = subcommands.add_parser( 'configure', help="Run CMake in the given build directory.") configure.add_argument( + '--source-dir', + dest='sources', + required=True, + help="Path to the sources directory. It should contain an LLVM worktree.") +configure.add_argument( '--build-dir', dest='build', required=True, |