@ -1034,35 +1034,36 @@ class Backend:
elif not isinstance ( i , str ) :
err_msg = ' Argument {0} is of unknown type {1} '
raise RuntimeError ( err_msg . format ( str ( i ) , str ( type ( i ) ) ) )
elif ' @SOURCE_ROOT@ ' in i :
i = i . replace ( ' @SOURCE_ROOT@ ' , source_root )
elif ' @BUILD_ROOT@ ' in i :
i = i . replace ( ' @BUILD_ROOT@ ' , build_root )
elif ' @DEPFILE@ ' in i :
if target . depfile is None :
msg = ' Custom target {!r} has @DEPFILE@ but no depfile ' \
' keyword argument. ' . format ( target . name )
raise MesonException ( msg )
dfilename = os . path . join ( outdir , target . depfile )
i = i . replace ( ' @DEPFILE@ ' , dfilename )
elif ' @PRIVATE_DIR@ ' in i :
if target . absolute_paths :
pdir = self . get_target_private_dir_abs ( target )
else :
pdir = self . get_target_private_dir ( target )
i = i . replace ( ' @PRIVATE_DIR@ ' , pdir )
elif ' @PRIVATE_OUTDIR_ ' in i :
match = re . search ( r ' @PRIVATE_OUTDIR_(ABS_)?([^/ \ s*]*)@ ' , i )
if not match :
msg = ' Custom target {!r} has an invalid argument {!r} ' \
' ' . format ( target . name , i )
raise MesonException ( msg )
source = match . group ( 0 )
if match . group ( 1 ) is None and not target . absolute_paths :
lead_dir = ' '
else :
lead_dir = self . environment . get_build_dir ( )
i = i . replace ( source , os . path . join ( lead_dir , outdir ) )
else :
if ' @SOURCE_ROOT@ ' in i :
i = i . replace ( ' @SOURCE_ROOT@ ' , source_root )
if ' @BUILD_ROOT@ ' in i :
i = i . replace ( ' @BUILD_ROOT@ ' , build_root )
if ' @DEPFILE@ ' in i :
if target . depfile is None :
msg = ' Custom target {!r} has @DEPFILE@ but no depfile ' \
' keyword argument. ' . format ( target . name )
raise MesonException ( msg )
dfilename = os . path . join ( outdir , target . depfile )
i = i . replace ( ' @DEPFILE@ ' , dfilename )
if ' @PRIVATE_DIR@ ' in i :
if target . absolute_paths :
pdir = self . get_target_private_dir_abs ( target )
else :
pdir = self . get_target_private_dir ( target )
i = i . replace ( ' @PRIVATE_DIR@ ' , pdir )
if ' @PRIVATE_OUTDIR_ ' in i :
match = re . search ( r ' @PRIVATE_OUTDIR_(ABS_)?([^/ \ s*]*)@ ' , i )
if not match :
msg = ' Custom target {!r} has an invalid argument {!r} ' \
' ' . format ( target . name , i )
raise MesonException ( msg )
source = match . group ( 0 )
if match . group ( 1 ) is None and not target . absolute_paths :
lead_dir = ' '
else :
lead_dir = self . environment . get_build_dir ( )
i = i . replace ( source , os . path . join ( lead_dir , outdir ) )
cmd . append ( i )
# Substitute the rest of the template strings
values = mesonlib . get_filenames_templates_dict ( inputs , outputs )