@@ -225,9 +225,6 @@ def run_test(self, opts):
225
225
opts .cmake = resolve_command_path (opts .cmake )
226
226
if not isexecfile (opts .cmake ):
227
227
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 )
231
228
opts .lit = resolve_command_path (opts .lit )
232
229
if not isexecfile (opts .lit ):
233
230
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):
387
384
if self .compiled and compile :
388
385
self ._clean (self ._base_path )
389
386
if not self .compiled or compile or self .opts .pgo :
390
- self ._make (self ._base_path )
387
+ self ._build (self ._base_path )
391
388
self ._install_benchmark (self ._base_path )
392
389
self .compiled = True
393
390
@@ -431,14 +428,14 @@ def _check_output(self, *args, **kwargs):
431
428
return output
432
429
433
430
def _clean (self , path ):
434
- make_cmd = self .opts .make
431
+ cmake_cmd = self .opts .cmake
435
432
436
433
subdir = path
437
434
if self .opts .only_test :
438
435
components = [path ] + [self .opts .only_test [0 ]]
439
436
subdir = os .path .join (* components )
440
437
441
- self ._check_call ([make_cmd , 'clean' ],
438
+ self ._check_call ([cmake_cmd , '--build' , '.' , '-t' , 'clean' ],
442
439
cwd = subdir )
443
440
444
441
def _configure (self , path , extra_cmake_defs = [], execute = True ):
@@ -449,6 +446,8 @@ def _configure(self, path, extra_cmake_defs=[], execute=True):
449
446
defs ['CMAKE_C_COMPILER' ] = self .opts .cc
450
447
if self .opts .cxx :
451
448
defs ['CMAKE_CXX_COMPILER' ] = self .opts .cxx
449
+ if self .opts .make :
450
+ defs ['CMAKE_MAKE_PROGRAM' ] = self .opts .make
452
451
453
452
cmake_build_types = ('DEBUG' , 'MINSIZEREL' , 'RELEASE' ,
454
453
'RELWITHDEBINFO' )
@@ -560,12 +559,12 @@ def _collect_pgo(self, path):
560
559
"TEST_SUITE_RUN_TYPE=train" ]
561
560
self ._configure (path , extra_cmake_defs = extra_defs )
562
561
self ._clean (self ._base_path )
563
- self ._make (path )
562
+ self ._build (path )
564
563
self ._install_benchmark (path )
565
564
self ._lit (path , True , False )
566
565
567
- def _make (self , path ):
568
- make_cmd = self .opts .make
566
+ def _build (self , path ):
567
+ cmake_cmd = self .opts .cmake
569
568
570
569
subdir = path
571
570
target = 'all'
@@ -576,24 +575,23 @@ def _make(self, path):
576
575
subdir = os .path .join (* components )
577
576
578
577
logger .info ('Building...' )
579
- if not self .opts .succinct :
580
- args = ["VERBOSE=1" , target ]
581
- else :
582
- args = [target ]
583
578
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" ]),
586
584
cwd = subdir )
587
585
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
589
587
# failure. Build failures are not unexpected when testing an
590
588
# experimental compiler.
591
589
pass
592
590
593
591
def _install_benchmark (self , path ):
594
592
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 )
597
595
598
596
def _lit (self , path , test , profile ):
599
597
lit_cmd = self .opts .lit
@@ -898,30 +896,30 @@ def diagnose(self):
898
896
logger .info (out )
899
897
900
898
# Figure out our test's target.
901
- make_cmd = [self .opts .make , "VERBOSE=1" , 'help' ]
899
+ cmake_cmd = [self .opts .cmake , '--build' , '.' , '-t' , 'help' ]
902
900
903
- make_targets = subprocess .check_output (make_cmd ,
904
- universal_newlines = True )
901
+ cmake_targets = subprocess .check_output (cmake_cmd ,
902
+ universal_newlines = True )
905
903
matcher = re .compile (r"^\.\.\.\s{}$" .format (short_name ),
906
904
re .MULTILINE | re .IGNORECASE )
907
- if not matcher .search (make_targets ):
905
+ if not matcher .search (cmake_targets ):
908
906
assert False , "did not find benchmark, nestsed? Unimplemented."
909
907
910
908
local_path = os .path .join (path , bm_path )
911
909
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 ,
916
914
stdout = subprocess .PIPE ,
917
915
stderr = subprocess .STDOUT ,
918
916
universal_newlines = True )
919
917
std_out , std_err = p .communicate ()
920
918
logger .info (std_out )
921
919
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 ,
925
923
stdout = subprocess .PIPE ,
926
924
stderr = subprocess .STDOUT ,
927
925
universal_newlines = True )
@@ -951,8 +949,8 @@ def diagnose(self):
951
949
out = subprocess .check_output (cmd_time_report , universal_newlines = True )
952
950
logger .info (out )
953
951
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 ,
956
954
stdout = subprocess .PIPE ,
957
955
stderr = subprocess .PIPE ,
958
956
universal_newlines = True )
@@ -971,8 +969,8 @@ def diagnose(self):
971
969
universal_newlines = True )
972
970
logger .info (out )
973
971
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 ,
976
974
stdout = subprocess .PIPE ,
977
975
stderr = subprocess .PIPE ,
978
976
universal_newlines = True )
@@ -1002,8 +1000,8 @@ def diagnose(self):
1002
1000
subprocess .check_output (cmd_iprofiler , universal_newlines = True )
1003
1001
1004
1002
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 ,
1007
1005
stdout = subprocess .PIPE ,
1008
1006
stderr = subprocess .PIPE )
1009
1007
p .communicate ()
@@ -1148,7 +1146,7 @@ def diagnose(self):
1148
1146
help = "write raw report data to PATH (or stdout if '-')" ,
1149
1147
default = None )
1150
1148
@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 )
1152
1150
@click .option ("-v" , "--verbose" , "verbose" , is_flag = True , default = False ,
1153
1151
help = "show verbose test results" )
1154
1152
@click .option ("--exclude-stat-from-submission" ,
@@ -1168,8 +1166,8 @@ def diagnose(self):
1168
1166
type = click .UNPROCESSED , default = "cmake" ,
1169
1167
help = "Path to CMake [cmake]" )
1170
1168
@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/... ]" )
1173
1171
@click .option ("--use-lit" , "lit" , metavar = "PATH" , type = click .UNPROCESSED ,
1174
1172
default = "llvm-lit" ,
1175
1173
help = "Path to the LIT test runner [llvm-lit]" )
0 commit comments