@@ -26,27 +26,29 @@ def get_arguments():
26
26
buildopt .add_argument ('-t' , '--target' , metavar = 'ARCH' , choices = ['X86' , 'AArch64' , 'PowerPC' ], default = 'X86' ,
27
27
help = 'Control which targets are enabled (%(choices)s) (default: %(default)s)' )
28
28
buildopt .add_argument ('-p' , '--install-prefix' , metavar = 'PATH' , nargs = '?' , default = None , const = False ,
29
- help = 'Install directory (default: do not install)' )
29
+ help = 'Specify installation directory (default: platform-specific location)' )
30
+ buildopt .add_argument ('-i' , '--install' , action = 'store_true' , default = False ,
31
+ help = 'Install LLVM (default: do not install)' )
30
32
buildopt .add_argument ('-j' , '--jobs' , metavar = 'N' , type = int , default = os .cpu_count (),
31
- help = 'number of parallel build jobs (default: %(default)s)' )
33
+ help = 'Number of parallel build jobs (default: %(default)s)' )
32
34
buildopt .add_argument ('--toolchain' , metavar = 'FILE' , default = default_toolchain ().as_posix (),
33
- help = 'specify toolchain file (default: %(default)s)' )
35
+ help = 'Specify toolchain file (default: %(default)s)' )
34
36
buildopt .add_argument ('-d' , '--builddir' , metavar = 'DIR' , default = 'build' ,
35
- help = f'specify build directory (default: { settings .LLVM_DIR } /%(default)s)' )
37
+ help = f'Specify build directory (default: { settings .LLVM_DIR } /%(default)s)' )
36
38
buildopt .add_argument ('--clean' , action = 'store_true' , default = False ,
37
- help = 'clean build' )
39
+ help = 'Clean build' )
38
40
buildopt .add_argument ('-b' , '--build-type' , metavar = 'TYPE' , default = 'Release' ,
39
- help = 'set build type (default: %(default)s)' )
41
+ help = 'Set build type (default: %(default)s)' )
40
42
buildopt .add_argument ('-x' , '--cmake-param' , metavar = 'OPT' , action = 'append' , default = [],
41
- help = 'add custom argument to CMake' )
43
+ help = 'Add custom argument to CMake' )
42
44
buildopt .add_argument ('-e' , '--llvm-enable-projects' , metavar = 'OPT' , action = 'append' , default = ['clang' ] if sys .platform == 'win32' else ['clang' , 'openmp' ],
43
- help = 'enable llvm projects to build (in quotation marks separated by semicolons e.g.: "clang;openmp")' )
45
+ help = 'Enable LLVM projects to build (in quotation marks separated by semicolons e.g.: "clang;openmp")' )
44
46
buildopt .add_argument ('-c' , '--use-ccache' , action = "store_true" , default = False ,
45
47
help = 'Using ccache during the build (default: %(default)s)' )
46
48
buildopt .add_argument ('--cc' , metavar = 'OPT' , default = None ,
47
- help = 'use specific C compiler' )
49
+ help = 'Use specific C compiler' )
48
50
buildopt .add_argument ('--cxx' , metavar = 'OPT' , default = None ,
49
- help = 'use specific C++ compiler' )
51
+ help = 'Use specific C++ compiler' )
50
52
buildopt .add_argument ('-v' , '--verbose' , action = 'store_true' , default = False ,
51
53
help = 'Verbose build (default: %(default)s' )
52
54
arguments = parser .parse_args ()
@@ -58,11 +60,8 @@ def generate_buildoptions(arguments):
58
60
f'-DCMAKE_TOOLCHAIN_FILE={ arguments .toolchain } '
59
61
]
60
62
61
- if sys .platform == 'win32' and platform .uname ()[4 ].lower () == 'arm64' :
62
- base_cmake_args .append ('-GNMake Makefiles' )
63
- else :
64
- generator = 'Ninja' if sys .platform == 'win32' else 'Unix Makefiles'
65
- base_cmake_args .append (f'-G{ generator } ' )
63
+ generator = 'Ninja' if sys .platform == 'win32' else 'Unix Makefiles'
64
+ base_cmake_args .append (f'-G{ generator } ' )
66
65
67
66
if arguments .install_prefix :
68
67
install_root = Path (arguments .install_prefix )
@@ -143,10 +142,10 @@ def print_header(title):
143
142
def main ():
144
143
arguments = get_arguments ()
145
144
146
- print_header ('Building classic llvm ' )
145
+ print_header ('Building classic LLVM ' )
147
146
build_path = configure_llvm (arguments )
148
147
build_project (build_path , arguments )
149
- if arguments .install_prefix is not None :
148
+ if arguments .install :
150
149
install_project (build_path , arguments )
151
150
152
151
if __name__ == "__main__" :
0 commit comments