mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
Replace the manually maintained header list with a Python script that finds all header files and includes them in order. This adds another 25 or so previously headers to the C++ compilation tests.
24 lines
478 B
Python
Executable file
24 lines
478 B
Python
Executable file
#!/usr/bin/env python3
|
|
#
|
|
# Generates a simple .cpp file including all of the SPA headers.
|
|
#
|
|
# Usage: gen-cpp-test.py path/to/pipewire.git/spa/include/spa
|
|
|
|
template = """
|
|
@@INCLUDES@@
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
return 0;
|
|
}
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
basedir = Path(sys.argv[1])
|
|
includes = [
|
|
"#include <{}>".format(f.relative_to(basedir.parent)) for f in sorted(basedir.rglob("*.h"))
|
|
]
|
|
|
|
print(template.replace("@@INCLUDES@@", "\n".join(includes)))
|