Skip to content
Snippets Groups Projects
Commit eb945dfd authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Build in Release by default

parent d3294cde
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ from os import chdir, environ, makedirs
from pathlib import Path
from subprocess import CalledProcessError, check_call
from typing import List, Union
from multiprocessing import cpu_count
VERSION = "9.0.0"
URL = "http://releases.llvm.org"
......@@ -52,8 +53,8 @@ def parse_args(args=None):
"-j",
"--parallel",
type=int,
default=2,
help="How many threads to build with. This argument is relayed on to 'make'. Default: 2",
default=cpu_count(),
help="How many threads to build with. This argument is relayed on to 'make'. Default: cpu_count()",
)
parser.add_argument(
"-b",
......@@ -83,15 +84,11 @@ def parse_args(args=None):
"-r", "--run-tests", action="store_true", help="Build and run test cases"
)
parser.add_argument(
"cmake_args",
type=str,
nargs="*",
default="",
help="Argument to relay on to CMake. Separate with space and do not include the dashes. "
"Example: DCMAKE_BUILD_TYPE=Release DCMAKE_INSTALL_PREFIX=install",
"-d", "--build-debug", action="store_true", help="Build debug instead of release"
)
args = parser.parse_args(args)
args.cmake_args = [f"-{arg}" for arg in args.cmake_args]
build_ty = "Debug" if args.build_debug else "Release"
args.cmake_args = [f"-DCMAKE_BUILD_TYPE={build_ty}"]
return args
......@@ -139,16 +136,6 @@ def prompt_args():
args.targets = input_with_check(
"Build target: ", parse_targets, "Input shouldn't contain space"
)
print(
"""Additional arguments to CMake? Split by space and no dashes.
Example: "DCMAKE_BUILD_TYPE=Release DCMAKE_INSTALL_PREFIX=install".
Arguments: """
)
args.cmake_args = input()
if args.cmake_args.strip() != "":
args.cmake_args = [f"-{arg}" for arg in args.cmake_args.split(" ")]
args.run_tests = input_with_check(
"Build and run tests? [y/n]: ", parse_yn, "Please enter y or n"
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment