1#!/usr/bin/env python3 2 3"This tool is intended to be used from meson" 4 5import os, sys, shutil 6 7if len (sys.argv) < 3: 8 sys.exit (__doc__) 9 10OUTPUT = sys.argv[1] 11CURRENT_SOURCE_DIR = sys.argv[2] 12sources = sys.argv[3:] 13 14with open (OUTPUT, "wb") as f: 15 f.write ("".join ('#include "{}"\n'.format (os.path.basename (x)) for x in sources if x.endswith (".cc")).encode ()) 16 17# copy it also to src/ 18shutil.copyfile (OUTPUT, os.path.join (CURRENT_SOURCE_DIR, os.path.basename (OUTPUT))) 19