@@ -329,7 +329,7 @@ def export_repos(config, ides, targets, exp_filter):
329
329
return results
330
330
331
331
332
- def compile_repos (config , toolchains , targets , profiles , verbose , exp_filter , jobs = 0 ):
332
+ def compile_repos (config , toolchains , targets , profiles , verbose , exp_filter , cmake = False , jobs = 0 ):
333
333
"""Compiles combinations of example programs, targets and compile chains.
334
334
335
335
The results are returned in a [key: value] dictionary format:
@@ -382,22 +382,31 @@ def compile_repos(config, toolchains, targets, profiles, verbose, exp_filter, jo
382
382
summary_string = "%s %s %s" % (name , target , toolchain )
383
383
logging .info ("Compiling %s" % summary_string )
384
384
385
- build_command = ["mbed-cli" , "compile" , "-t" , toolchain , "-m" , target , "-j" , str (jobs )] + (['-vv' ] if verbose else [])
386
- if profiles :
387
- for profile in profiles :
388
- build_command .extend (["--profile" , profile ])
389
-
390
- logging .info ("Executing command '%s'..." % " " .join (build_command ))
391
- proc = subprocess .Popen (build_command , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
392
-
393
- std_out , std_err = proc .communicate ()
394
- std_out = std_out .decode ()
395
- std_err = std_err .decode ()
396
- print ("\n #### STDOUT ####\n %s\n #### STDERR ####\n %s\n #### End of STDOUT/STDERR ####\n " % (std_out ,std_err ))
397
-
398
- if proc .returncode :
399
- failures .append (example_summary )
385
+ if cmake :
386
+ build_command_seq = ["mbed-tools configure -t {} -m {}" .format (toolchain ,target ), "cmake -S . -B cmake_build -GNinja" , "cmake --build cmake_build" ]
400
387
else :
388
+ build_command_seq = ["mbed-cli compile -t {} -m {} -j {} {}" .format (toolchain , target , str (jobs ), '-vv' if verbose else '' ) ]
389
+ if profiles :
390
+ for profile in profiles :
391
+ build_command_seq [0 ] += " --profile {}" .format (profile )
392
+
393
+ failed_flag = False
394
+ for build_command in build_command_seq :
395
+ logging .info ("Executing command '%s'..." % build_command )
396
+ proc = subprocess .Popen (build_command .split (), stdout = subprocess .PIPE , stderr = subprocess .PIPE )
397
+
398
+ std_out , std_err = proc .communicate ()
399
+ std_out = std_out .decode ()
400
+ std_err = std_err .decode ()
401
+ print ("\n #### STDOUT ####\n %s\n #### STDERR ####\n %s\n #### End of STDOUT/STDERR ####\n " % (std_out ,std_err ))
402
+
403
+ if proc .returncode :
404
+ failures .append (example_summary )
405
+ failed_flag = True
406
+ break
407
+
408
+
409
+ if not failed_flag :
401
410
if example ['test' ]:
402
411
log = example ['compare_log' ].pop (0 )
403
412
# example['compare_log'] is a list of log file/files, which matches each examples/sub-examples from same repo.
@@ -485,6 +494,7 @@ def symlink_mbedos(config, path, exp_filter):
485
494
else :
486
495
logging .info ("Creating Symbolic link '%s'->'mbed-os'" % path )
487
496
os .symlink (path , "mbed-os" )
497
+ open ('mbed-os.lib' , 'a' ).close ()
488
498
os .chdir (CWD )
489
499
return 0
490
500
0 commit comments