-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
28 lines (24 loc) · 895 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright 2024 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
#
# Author: Luca Colagrande <[email protected]>
import setuptools
from setuptools.command.build import build
import subprocess
from pathlib import Path
class CMakeBuild(build):
def run(self):
# Required to generate "flexfloat_config.h"
builddir = Path(__file__).parent / 'flexfloat/build'
builddir.mkdir(parents=True, exist_ok=True)
subprocess.run(['pwd'], cwd=builddir, check=True)
subprocess.run(['ls', '..'], cwd=builddir, check=True)
subprocess.run(['cmake', '..'], cwd=builddir, check=True)
setuptools.setup(
packages=setuptools.find_packages(),
setup_requires=['cffi'],
install_requires=['cffi'],
cffi_modules=["pyflexfloat/build_flexfloat_ffi.py:ffibuilder"],
cmdclass={'build': CMakeBuild}
)