setup.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. """Build script for mypyc C runtime library unit tests.
  2. The tests are written in C++ and use the Google Test framework.
  3. """
  4. from __future__ import annotations
  5. import sys
  6. from distutils.core import Extension, setup
  7. from typing import Any
  8. kwargs: dict[str, Any]
  9. if sys.platform == "darwin":
  10. kwargs = {"language": "c++"}
  11. compile_args = []
  12. else:
  13. kwargs = {}
  14. compile_args = ["--std=c++11"]
  15. setup(
  16. name="test_capi",
  17. version="0.1",
  18. ext_modules=[
  19. Extension(
  20. "test_capi",
  21. [
  22. "test_capi.cc",
  23. "init.c",
  24. "int_ops.c",
  25. "float_ops.c",
  26. "list_ops.c",
  27. "exc_ops.c",
  28. "generic_ops.c",
  29. ],
  30. depends=["CPy.h", "mypyc_util.h", "pythonsupport.h"],
  31. extra_compile_args=["-Wno-unused-function", "-Wno-sign-compare"] + compile_args,
  32. library_dirs=["../external/googletest/make"],
  33. libraries=["gtest"],
  34. include_dirs=["../external/googletest", "../external/googletest/include"],
  35. **kwargs,
  36. )
  37. ],
  38. )