@@ -620,6 +620,7 @@ def getCmakeExBuildFactory(
620
620
post_finalize_steps = None ,
621
621
jobs = None , # Restrict a degree of parallelism.
622
622
env = None , # Common environmental variables.
623
+ hint = None ,
623
624
):
624
625
625
626
""" Create and configure a builder factory to build a LLVM project from the unified source tree.
@@ -789,6 +790,15 @@ def getCmakeExBuildFactory(
789
790
env : dict, optional
790
791
Common environmental variables for all build steps (default is None).
791
792
793
+ hint : string, optional
794
+ Use this hint to apply suffixes to the step names when factory is used as a nested factory for another one.
795
+ The suffix will be added to the step name separated by dash symbol.
796
+
797
+ As example, passing of 'stageX' with 'hint' will force generating of the following step names:
798
+ cmake-cofigure => cmake-configure-stageX
799
+ build => build-stageX
800
+ install => install-stageX
801
+ & etc.
792
802
793
803
Returns
794
804
-------
@@ -866,6 +876,7 @@ def norm_target_list_arg(lst):
866
876
f = LLVMBuildFactory (
867
877
depends_on_projects = depends_on_projects ,
868
878
enable_runtimes = enable_runtimes ,
879
+ hint = hint ,
869
880
llvm_srcdir = llvm_srcdir ,
870
881
src_to_build_dir = src_to_build_dir ,
871
882
obj_dir = obj_dir ,
@@ -875,7 +886,7 @@ def norm_target_list_arg(lst):
875
886
f .addSteps ([
876
887
# Set up some properties, which could be used to configure the builders.
877
888
steps .SetProperties (
878
- name = 'set-props' ,
889
+ name = f . makeStepName ( 'set-props' ) ,
879
890
properties = {
880
891
"depends_on_projects" : ";" .join (sorted (f .depends_on_projects )),
881
892
"enable_projects" : ";" .join (sorted (f .enable_projects )),
@@ -889,7 +900,7 @@ def norm_target_list_arg(lst):
889
900
# This is an incremental build, unless otherwise has been requested.
890
901
# Remove obj dirs for a clean build.
891
902
steps .RemoveDirectory (
892
- name = 'clean-obj-dir' ,
903
+ name = f . makeStepName ( 'clean-obj-dir' ) ,
893
904
dir = util .Interpolate (f .obj_dir ),
894
905
description = ["Remove" , util .Interpolate (f .obj_dir ), "directory" ],
895
906
haltOnFailure = False ,
@@ -926,7 +937,7 @@ def norm_target_list_arg(lst):
926
937
if vs :
927
938
f .addStep (
928
939
steps .SetPropertyFromCommand (
929
- name = "set-props.vs_env" ,
940
+ name = f . makeStepName ( "set-props.vs_env" ) ,
930
941
command = builders_util .getVisualStudioEnvironment (vs , vs_arch ),
931
942
extract_fn = builders_util .extractVSEnvironment ,
932
943
env = env
@@ -952,7 +963,7 @@ def norm_target_list_arg(lst):
952
963
# Remove install directory.
953
964
f .addSteps ([
954
965
steps .RemoveDirectory (
955
- name = f"clean-install-dir" ,
966
+ name = f . makeStepName ( "clean-install-dir" ) ,
956
967
dir = util .Interpolate (f .install_dir ),
957
968
description = ["Remove" , util .Interpolate (f .install_dir ), "directory" ],
958
969
haltOnFailure = False ,
@@ -972,7 +983,7 @@ def norm_target_list_arg(lst):
972
983
973
984
f .addStep (
974
985
steps .CMake (
975
- name = f"cmake-configure" ,
986
+ name = f . makeStepName ( "cmake-configure" ) ,
976
987
path = LLVMBuildFactory .pathRelativeTo (f .llvm_srcdir , f .obj_dir ),
977
988
generator = generator ,
978
989
definitions = cmake_definitions ,
@@ -983,6 +994,7 @@ def norm_target_list_arg(lst):
983
994
workdir = f .obj_dir
984
995
))
985
996
997
+ hint_suffix = f"-{ hint } " if hint else None
986
998
# Build Commands.
987
999
#NOTE: please note that the default target (.) cannot be specified by the IRenderable object.
988
1000
for target in targets :
@@ -996,7 +1008,8 @@ def norm_target_list_arg(lst):
996
1008
997
1009
f .addStep (
998
1010
steps .CMake (
999
- name = util .Interpolate ("build-%(kw:title)s" , title = target_title ),
1011
+ name = util .Interpolate ("build-%(kw:title)s%(kw:hint:-)s" ,
1012
+ title = target_title , hint = hint_suffix ),
1000
1013
options = cmake_build_options ,
1001
1014
description = ["Build target" , target_title ],
1002
1015
haltOnFailure = True ,
@@ -1012,7 +1025,8 @@ def norm_target_list_arg(lst):
1012
1025
for target in checks :
1013
1026
f .addStep (
1014
1027
LitTestCommand (
1015
- name = util .Interpolate ("test-%(kw:title)s" , title = target ),
1028
+ name = util .Interpolate ("test-%(kw:title)s%(kw:hint:-)s" ,
1029
+ title = target , hint = hint_suffix ),
1016
1030
command = [steps .CMake .DEFAULT_CMAKE , "--build" , "." , "--target" , target ],
1017
1031
description = ["Test just built components:" , target ],
1018
1032
descriptionDone = ["Test just built components:" , target , "completed" ],
@@ -1025,7 +1039,8 @@ def norm_target_list_arg(lst):
1025
1039
for target , cmd in checks_on_target :
1026
1040
f .addStep (
1027
1041
LitTestCommand (
1028
- name = util .Interpolate ("test-%(kw:title)s" , title = target ),
1042
+ name = util .Interpolate ("test-%(kw:title)s%(kw:hint:-)s" ,
1043
+ title = target , hint = hint_suffix ),
1029
1044
command = cmd ,
1030
1045
description = ["Test just built components:" , target ],
1031
1046
descriptionDone = ["Test just built components:" , target , "completed" ],
@@ -1044,7 +1059,7 @@ def norm_target_list_arg(lst):
1044
1059
f .addStep (
1045
1060
steps .CMake (
1046
1061
name = util .Transform (lambda s : s if s .startswith ("install" ) else f"install-{ s } " ,
1047
- util .Interpolate ("%(kw:title)s" , title = target )),
1062
+ util .Interpolate ("%(kw:title)s%(kw:hint:-)s " , title = target , hint = hint_suffix )),
1048
1063
options = ["--build" , "." , "--target" , target ],
1049
1064
description = ["Install just built components:" , target ],
1050
1065
haltOnFailure = False ,
0 commit comments