Files
rk35xx-android14/external/pthreadpool/configure.py
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

39 lines
1.2 KiB
Python
Executable File

#!/usr/bin/env python
import confu
parser = confu.standard_parser("pthreadpool configuration script")
def main(args):
options = parser.parse_args(args)
build = confu.Build.from_options(options)
build.export_cpath("include", ["pthreadpool.h"])
with build.options(source_dir="src", extra_include_dirs="src", deps=build.deps.fxdiv):
sources = ["legacy-api.c", "portable-api.c"]
if build.target.is_emscripten:
sources.append("shim.c")
elif build.target.is_macos:
sources.append("gcd.c")
elif build.target.is_windows:
sources.append("windows.c")
else:
sources.append("pthreads.c")
build.static_library("pthreadpool", [build.cc(src) for src in sources])
with build.options(source_dir="test", deps=[build, build.deps.googletest]):
build.unittest("pthreadpool-test", build.cxx("pthreadpool.cc"))
with build.options(source_dir="bench", deps=[build, build.deps.googlebenchmark]):
build.benchmark("latency-bench", build.cxx("latency.cc"))
build.benchmark("throughput-bench", build.cxx("throughput.cc"))
return build
if __name__ == "__main__":
import sys
main(sys.argv[1:]).generate()