@@ -1039,35 +1039,26 @@ def configure_substitutions(self):
1039
1039
if self .target_info .is_darwin ():
1040
1040
# Do not pass DYLD_LIBRARY_PATH to the compiler, linker, etc. as
1041
1041
# these tools are not meant to exercise the just-built libraries.
1042
- tool_env += 'env DYLD_LIBRARY_PATH="" '
1042
+ tool_env += 'env DYLD_LIBRARY_PATH=""'
1043
1043
1044
1044
sub = self .config .substitutions
1045
- cxx_path = tool_env + pipes .quote (self .cxx .path )
1046
1045
# Configure compiler substitutions
1047
- sub .append (('%{cxx}' , cxx_path ))
1046
+ sub .append (('%{cxx}' , '{} {}' . format ( tool_env , pipes . quote ( self . cxx . path )) ))
1048
1047
sub .append (('%{libcxx_src_root}' , self .libcxx_src_root ))
1049
1048
# Configure flags substitutions
1050
- flags_str = ' ' .join ([pipes .quote (f ) for f in self .cxx .flags ])
1051
- compile_flags_str = ' ' .join ([pipes .quote (f ) for f in self .cxx .compile_flags ])
1052
- link_flags_str = ' ' .join ([pipes .quote (f ) for f in self .cxx .link_flags ])
1053
- all_flags = '%s %s %s' % (flags_str , compile_flags_str , link_flags_str )
1054
- sub .append (('%{flags}' , flags_str ))
1055
- sub .append (('%{compile_flags}' , compile_flags_str ))
1056
- sub .append (('%{link_flags}' , link_flags_str ))
1049
+ sub .append (('%{flags}' , ' ' .join (map (pipes .quote , self .cxx .flags ))))
1050
+ sub .append (('%{compile_flags}' , ' ' .join (map (pipes .quote , self .cxx .compile_flags ))))
1051
+ sub .append (('%{link_flags}' , ' ' .join (map (pipes .quote , self .cxx .link_flags ))))
1057
1052
if self .cxx .isVerifySupported ():
1058
- verify_str = ' ' + ' ' .join (self .cxx .verify_flags ) + ' '
1059
- sub .append (('%{verify}' , verify_str ))
1060
- # Add compile and link shortcuts
1061
- compile_str = (cxx_path + ' -o %t.o %s -c ' + flags_str
1062
- + ' ' + compile_flags_str )
1063
- build_str = cxx_path + ' -o %t.exe %s ' + all_flags
1053
+ sub .append (('%{verify}' , ' ' .join (self .cxx .verify_flags )))
1054
+ # Add compile and build shortcuts
1055
+ sub .append (('%{compile}' , '%{cxx} -o %t.o %s -c %{flags} %{compile_flags}' ))
1056
+ sub .append (('%{build}' , '%{cxx} -o %t.exe %s %{flags} %{compile_flags} %{link_flags}' ))
1064
1057
if self .cxx .use_modules :
1065
- sub .append (('%{build_module}' , build_str ))
1058
+ sub .append (('%{build_module}' , '%{build}' ))
1066
1059
elif self .cxx .modules_flags is not None :
1067
- modules_str = ' ' .join (self .cxx .modules_flags ) + ' '
1068
- sub .append (('%{build_module}' , build_str + ' ' + modules_str ))
1069
- sub .append (('%{compile}' , compile_str ))
1070
- sub .append (('%{build}' , build_str ))
1060
+ sub .append (('%{build_module}' , '%{{build}} {}' .format (' ' .join (self .cxx .modules_flags ))))
1061
+
1071
1062
# Configure exec prefix substitutions.
1072
1063
# Configure run env substitution.
1073
1064
codesign_ident = self .get_lit_conf ('llvm_codesign_identity' , '' )
@@ -1077,13 +1068,11 @@ def configure_substitutions(self):
1077
1068
'--dependencies %%file_dependencies --env %s -- ' % \
1078
1069
(pipes .quote (sys .executable ), pipes .quote (run_py ),
1079
1070
codesign_ident , env_vars )
1080
- run_str = exec_str + '%t.exe'
1081
1071
sub .append (('%{exec}' , exec_str ))
1082
- sub .append (('%{run}' , run_str ))
1072
+ sub .append (('%{run}' , '%{exec} %t.exe' ))
1083
1073
# Configure not program substitutions
1084
1074
not_py = os .path .join (self .libcxx_src_root , 'utils' , 'not.py' )
1085
- not_str = '%s %s ' % (pipes .quote (sys .executable ), pipes .quote (not_py ))
1086
- sub .append (('%{not} ' , not_str ))
1075
+ sub .append (('%{not}' , '{} {}' .format (pipes .quote (sys .executable ), pipes .quote (not_py ))))
1087
1076
if self .get_lit_conf ('libcxx_gdb' ):
1088
1077
sub .append (('%{libcxx_gdb}' , self .get_lit_conf ('libcxx_gdb' )))
1089
1078
0 commit comments