@ -3540,9 +3540,13 @@ root and issuing %s.
raise InterpreterException ( ' @INPUT@ used as command argument, but no input file specified. ' )
# Validate output
output = kwargs [ ' output ' ]
ofile_rpath = os . path . join ( self . subdir , output )
if not isinstance ( output , str ) :
raise InterpreterException ( ' Output file name must be a string ' )
if ifile_abs :
values = mesonlib . get_filenames_templates_dict ( [ ifile_abs ] , None )
outputs = mesonlib . substitute_values ( [ output ] , values )
output = outputs [ 0 ]
ofile_rpath = os . path . join ( self . subdir , output )
if ofile_rpath in self . configure_file_outputs :
mesonbuildfile = os . path . join ( self . subdir , ' meson.build ' )
current_call = " {} : {} " . format ( mesonbuildfile , self . current_lineno )
@ -3550,10 +3554,6 @@ root and issuing %s.
mlog . warning ( ' Output file ' , mlog . bold ( ofile_rpath , True ) , ' for configure_file() at ' , current_call , ' overwrites configure_file() output at ' , first_call )
else :
self . configure_file_outputs [ ofile_rpath ] = self . current_lineno
if ifile_abs :
values = mesonlib . get_filenames_templates_dict ( [ ifile_abs ] , None )
outputs = mesonlib . substitute_values ( [ output ] , values )
output = outputs [ 0 ]
if os . path . dirname ( output ) != ' ' :
raise InterpreterException ( ' Output file name must not contain a subdirectory. ' )
( ofile_path , ofile_fname ) = os . path . split ( os . path . join ( self . subdir , output ) )