rabbitizer/setup.py

32 lines
1.1 KiB
Python
Raw Normal View History

2024-01-28 15:16:11 +00:00
# SPDX-FileCopyrightText: © 2022-2024 Decompollaborate
2022-06-04 16:28:51 +00:00
# SPDX-License-Identifier: MIT
2022-06-06 21:14:17 +00:00
from setuptools import setup, Extension
from pathlib import Path
2023-04-30 13:47:00 +00:00
import platform
2022-06-04 15:19:03 +00:00
bindingsPath = Path("rabbitizer")
srcPath = Path("src")
sourcesList = [str(x) for x in bindingsPath.glob("**/*.c")] + [str(x) for x in srcPath.glob("**/*.c")]
headersList = [str(x) for x in bindingsPath.glob("**/*.h")] + [str(x) for x in srcPath.glob("**/*.h")]
2022-06-04 15:19:03 +00:00
2023-04-30 13:47:00 +00:00
extraCompileArgs = ["-std=c11", "-Wall", "-g",]
if platform.system() == "Linux":
extraCompileArgs += ["-Os", "-Wextra",]
2023-04-30 13:47:00 +00:00
extraCompileArgs += ["-Werror=vla", "-Werror=switch", "-Werror=implicit-fallthrough", "-Werror=unused-function", "-Werror=unused-parameter", "-Werror=shadow", "-Werror=switch"]
extraCompileArgs += ["-Werror=implicit-function-declaration", "-Werror=incompatible-pointer-types"]
extraCompileArgs += ["-Werror"]
2022-06-04 15:19:03 +00:00
setup(
ext_modules=[
Extension(
name="rabbitizer",
sources=sourcesList,
include_dirs=["include", "rabbitizer", "tables"],
2023-04-30 13:47:00 +00:00
extra_compile_args = extraCompileArgs,
depends=headersList,
2022-06-04 15:19:03 +00:00
),
],
)