@@ -225,9 +225,6 @@ def run_test(self, opts):
225225 opts .cmake = resolve_command_path (opts .cmake )
226226 if not isexecfile (opts .cmake ):
227227 self ._fatal ("CMake tool not found (looked for %s)" % opts .cmake )
228- opts .make = resolve_command_path (opts .make )
229- if not isexecfile (opts .make ):
230- self ._fatal ("Make tool not found (looked for %s)" % opts .make )
231228 opts .lit = resolve_command_path (opts .lit )
232229 if not isexecfile (opts .lit ):
233230 self ._fatal ("LIT tool not found (looked for %s)" % opts .lit )
@@ -387,7 +384,7 @@ def run(self, cmake_vars, compile=True, test=True, profile=False):
387384 if self .compiled and compile :
388385 self ._clean (self ._base_path )
389386 if not self .compiled or compile or self .opts .pgo :
390- self ._make (self ._base_path )
387+ self ._build (self ._base_path )
391388 self ._install_benchmark (self ._base_path )
392389 self .compiled = True
393390
@@ -431,14 +428,14 @@ def _check_output(self, *args, **kwargs):
431428 return output
432429
433430 def _clean (self , path ):
434- make_cmd = self .opts .make
431+ cmake_cmd = self .opts .cmake
435432
436433 subdir = path
437434 if self .opts .only_test :
438435 components = [path ] + [self .opts .only_test [0 ]]
439436 subdir = os .path .join (* components )
440437
441- self ._check_call ([make_cmd , 'clean' ],
438+ self ._check_call ([cmake_cmd , '--build' , '.' , '-t' , 'clean' ],
442439 cwd = subdir )
443440
444441 def _configure (self , path , extra_cmake_defs = [], execute = True ):
@@ -449,6 +446,8 @@ def _configure(self, path, extra_cmake_defs=[], execute=True):
449446 defs ['CMAKE_C_COMPILER' ] = self .opts .cc
450447 if self .opts .cxx :
451448 defs ['CMAKE_CXX_COMPILER' ] = self .opts .cxx
449+ if self .opts .make :
450+ defs ['CMAKE_MAKE_PROGRAM' ] = self .opts .make
452451
453452 cmake_build_types = ('DEBUG' , 'MINSIZEREL' , 'RELEASE' ,
454453 'RELWITHDEBINFO' )
@@ -560,12 +559,12 @@ def _collect_pgo(self, path):
560559 "TEST_SUITE_RUN_TYPE=train" ]
561560 self ._configure (path , extra_cmake_defs = extra_defs )
562561 self ._clean (self ._base_path )
563- self ._make (path )
562+ self ._build (path )
564563 self ._install_benchmark (path )
565564 self ._lit (path , True , False )
566565
567- def _make (self , path ):
568- make_cmd = self .opts .make
566+ def _build (self , path ):
567+ cmake_cmd = self .opts .cmake
569568
570569 subdir = path
571570 target = 'all'
@@ -576,24 +575,23 @@ def _make(self, path):
576575 subdir = os .path .join (* components )
577576
578577 logger .info ('Building...' )
579- if not self .opts .succinct :
580- args = ["VERBOSE=1" , target ]
581- else :
582- args = [target ]
583578 try :
584- self ._check_call ([make_cmd ,
585- '-k' , '-j' , str (self ._build_threads ())] + args ,
579+ self ._check_call ([cmake_cmd ,
580+ '--build' , '.' ,
581+ '-t' , target ,
582+ '-j' , str (self ._build_threads ())] +
583+ ([] if self .opts .succinct else ["-v" ]),
586584 cwd = subdir )
587585 except subprocess .CalledProcessError :
588- # make is expected to exit with code 1 if there was any build
586+ # cmake is expected to exit with code 1 if there was any build
589587 # failure. Build failures are not unexpected when testing an
590588 # experimental compiler.
591589 pass
592590
593591 def _install_benchmark (self , path ):
594592 if self .remote_run :
595- make_cmd = self .opts .make
596- self ._check_call ([make_cmd , 'rsync' ], cwd = path )
593+ cmake_cmd = self .opts .cmake
594+ self ._check_call ([cmake_cmd , '--build' , '.' , '-t' , 'rsync' ], cwd = path )
597595
598596 def _lit (self , path , test , profile ):
599597 lit_cmd = self .opts .lit
@@ -898,30 +896,30 @@ def diagnose(self):
898896 logger .info (out )
899897
900898 # Figure out our test's target.
901- make_cmd = [self .opts .make , "VERBOSE=1" , 'help' ]
899+ cmake_cmd = [self .opts .cmake , '--build' , '.' , '-t' , 'help' ]
902900
903- make_targets = subprocess .check_output (make_cmd ,
904- universal_newlines = True )
901+ cmake_targets = subprocess .check_output (cmake_cmd ,
902+ universal_newlines = True )
905903 matcher = re .compile (r"^\.\.\.\s{}$" .format (short_name ),
906904 re .MULTILINE | re .IGNORECASE )
907- if not matcher .search (make_targets ):
905+ if not matcher .search (cmake_targets ):
908906 assert False , "did not find benchmark, nestsed? Unimplemented."
909907
910908 local_path = os .path .join (path , bm_path )
911909
912- make_deps = [self .opts .make , "VERBOSE=1 " , "timeit-target" ,
913- "timeit-host" , "fpcmp-host" ]
914- logger .info (" " .join (make_deps ))
915- p = subprocess .Popen (make_deps ,
910+ cmake_deps = [self .opts .cmake , "--build" , '.' , "-t " , "timeit-target" ,
911+ "timeit-host" , "fpcmp-host" ]
912+ logger .info (" " .join (cmake_deps ))
913+ p = subprocess .Popen (cmake_deps ,
916914 stdout = subprocess .PIPE ,
917915 stderr = subprocess .STDOUT ,
918916 universal_newlines = True )
919917 std_out , std_err = p .communicate ()
920918 logger .info (std_out )
921919
922- make_save_temps = [self .opts .make , "VERBOSE=1 " , short_name ]
923- logger .info (" " .join (make_save_temps ))
924- p = subprocess .Popen (make_save_temps ,
920+ cmake_save_temps = [self .opts .cmake , "--build" , '.' , "-t " , short_name ]
921+ logger .info (" " .join (cmake_save_temps ))
922+ p = subprocess .Popen (cmake_save_temps ,
925923 stdout = subprocess .PIPE ,
926924 stderr = subprocess .STDOUT ,
927925 universal_newlines = True )
@@ -951,8 +949,8 @@ def diagnose(self):
951949 out = subprocess .check_output (cmd_time_report , universal_newlines = True )
952950 logger .info (out )
953951
954- make_time_report = [self .opts .make , "VERBOSE=1 " , short_name ]
955- p = subprocess .Popen (make_time_report ,
952+ cmake_time_report = [self .opts .cmake , "--build" , '.' , "-t " , short_name ]
953+ p = subprocess .Popen (cmake_time_report ,
956954 stdout = subprocess .PIPE ,
957955 stderr = subprocess .PIPE ,
958956 universal_newlines = True )
@@ -971,8 +969,8 @@ def diagnose(self):
971969 universal_newlines = True )
972970 logger .info (out )
973971
974- make_stats_report = [self .opts .make , "VERBOSE=1 " , short_name ]
975- p = subprocess .Popen (make_stats_report ,
972+ cmake_stats_report = [self .opts .cmake , "--build" , '.' , "-t " , short_name ]
973+ p = subprocess .Popen (cmake_stats_report ,
976974 stdout = subprocess .PIPE ,
977975 stderr = subprocess .PIPE ,
978976 universal_newlines = True )
@@ -1002,8 +1000,8 @@ def diagnose(self):
10021000 subprocess .check_output (cmd_iprofiler , universal_newlines = True )
10031001
10041002 os .chdir (local_path )
1005- make_iprofiler_temps = [self .opts .make , "VERBOSE=1 " , short_name ]
1006- p = subprocess .Popen (make_iprofiler_temps ,
1003+ cmake_iprofiler_temps = [self .opts .cmake , "--build" , '.' , "-t " , short_name ]
1004+ p = subprocess .Popen (cmake_iprofiler_temps ,
10071005 stdout = subprocess .PIPE ,
10081006 stderr = subprocess .PIPE )
10091007 p .communicate ()
@@ -1148,7 +1146,7 @@ def diagnose(self):
11481146 help = "write raw report data to PATH (or stdout if '-')" ,
11491147 default = None )
11501148@click .option ("--succinct-compile-output" , "succinct" ,
1151- help = "run Make without VERBOSE=1 " , is_flag = True )
1149+ help = "run CMake without -v " , is_flag = True )
11521150@click .option ("-v" , "--verbose" , "verbose" , is_flag = True , default = False ,
11531151 help = "show verbose test results" )
11541152@click .option ("--exclude-stat-from-submission" ,
@@ -1168,8 +1166,8 @@ def diagnose(self):
11681166 type = click .UNPROCESSED , default = "cmake" ,
11691167 help = "Path to CMake [cmake]" )
11701168@click .option ("--use-make" , "make" , metavar = "PATH" ,
1171- type = click .UNPROCESSED , default = "make" ,
1172- help = "Path to Make [make]" )
1169+ type = click .UNPROCESSED ,
1170+ help = "Path to the build system tool [make/ninja/... ]" )
11731171@click .option ("--use-lit" , "lit" , metavar = "PATH" , type = click .UNPROCESSED ,
11741172 default = "llvm-lit" ,
11751173 help = "Path to the LIT test runner [llvm-lit]" )
0 commit comments