4 SUFFIXS
= (".c", ".h", ".cc", ".hh", ".cpp", ".hpp", ".cxx", ".hxx")
7 for dirpath
, dirnames
, filenames
in os
.walk("include"):
8 for filename
in filenames
:
9 source
= os
.path
.join(dirpath
, filename
)
10 prefix
, suffix
= os
.path
.splitext(source
)
12 sources
.append(source
.replace("\\", "/"))
13 for dirpath
, dirnames
, filenames
in os
.walk("src"):
14 for filename
in filenames
:
15 source
= os
.path
.join(dirpath
, filename
)
16 prefix
, suffix
= os
.path
.splitext(source
)
18 sources
.append(source
.replace("\\", "/"))
19 sources
= sorted(sources
)
21 with
open("meson.build", "r") as f
:
23 new
= "[\n '" + "',\n '".join(sources
) + "',\n]\n"
24 old
= re
.findall(r
"sources = ([^\]]+)", meson
)[0] + "]\n"
25 with
open("meson.build", "wb") as f
:
26 meson
= f
.write(meson
.replace(old
, new
).encode())