mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-02-21 09:16:30 +00:00
improved build system
This commit is contained in:
@@ -16,20 +16,12 @@ def _find_sources() -> list[str]:
|
||||
|
||||
def _find_flags() -> dict[str, bool]:
|
||||
return {
|
||||
key: bool(int(value))
|
||||
key[3:]: (value.strip().lower() in ["true", "on", "1"])
|
||||
for (key, value) in sorted(os.environ.items())
|
||||
if key.startswith("WITH_")
|
||||
if key.startswith("MK_WITH_")
|
||||
}
|
||||
|
||||
|
||||
def _make_d_flags(flags: dict[str, bool]) -> list[str]:
|
||||
return [
|
||||
f"-D{key}"
|
||||
for (key, value) in flags.items()
|
||||
if value
|
||||
]
|
||||
|
||||
|
||||
def _make_d_features(flags: dict[str, bool]) -> str:
|
||||
features = " ".join([
|
||||
f"{key}={int(value)}"
|
||||
@@ -54,7 +46,6 @@ def main() -> None:
|
||||
extra_compile_args=[
|
||||
"-std=c17", "-D_GNU_SOURCE",
|
||||
_make_d_features(flags),
|
||||
*_make_d_flags(flags),
|
||||
],
|
||||
undef_macros=["NDEBUG"],
|
||||
sources=_find_sources(),
|
||||
|
||||
Reference in New Issue
Block a user