diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2022-06-27 01:13:26 +0200 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2022-06-27 01:13:26 +0200 |
| commit | 8d1d7b7b4a48187f5849548bbc6bb543d6de33ba (patch) | |
| tree | 557eff5ff465d1ff096abbcca0005dca08ca959c /src_doit | |
| parent | 75cc60fd42c58cadc28f5eb4499f197604254aba (diff) | |
WIP native implementation
Diffstat (limited to 'src_doit')
| -rw-r--r-- | src_doit/__init__.py | 3 | ||||
| -rw-r--r-- | src_doit/c.py | 22 |
2 files changed, 8 insertions, 17 deletions
diff --git a/src_doit/__init__.py b/src_doit/__init__.py index 8402cfc..3daba9f 100644 --- a/src_doit/__init__.py +++ b/src_doit/__init__.py @@ -112,8 +112,7 @@ def task_ui(): def task_deps(): """Install dependencies""" - return {'actions': ['yarn install --silent', - f'{sys.executable} -m peru sync']} + return {'actions': ['yarn install --silent']} def task_format(): diff --git a/src_doit/c.py b/src_doit/c.py index 69b8cb5..b5deb0d 100644 --- a/src_doit/c.py +++ b/src_doit/c.py @@ -1,7 +1,7 @@ from pathlib import Path from hat.doit import common -from hat.doit.c import (get_exe_suffix, +from hat.doit.c import (get_lib_suffix, CBuild) @@ -21,28 +21,20 @@ platforms = [common.local_platform] if common.local_platform == common.Platform.LINUX_X86_64: platforms.append(common.Platform.WINDOWS_AMD64) -builds = [CBuild(src_paths=[*src_c_dir.rglob('*.c'), - deps_dir / 'argparse/argparse.c', - deps_dir / 'hat-util/src_c/hat/libc_allocator.c'], +builds = [CBuild(src_paths=[*src_c_dir.rglob('*.c')], build_dir=build_c_dir / platform.name.lower(), platform=platform, - cc_flags=['-fPIC', '-O2', - f'-I{deps_dir / "jsmn"}', - f'-I{deps_dir / "argparse"}', - f'-I{deps_dir / "hat-util/src_c"}'], - task_dep=['deps']) + cc_flags=['-fPIC', '-O2']) for platform in platforms] -exe_paths = [src_py_dir / (f'opcut/bin/{platform.name.lower()}-' - f'opcut-calculate' - f'{get_exe_suffix(platform)}') +lib_paths = [src_py_dir / (f'opcut/libopcut{get_lib_suffix(platform)}') for platform in platforms] def task_c(): - """Build native app""" - for build, exe_path in zip(builds, exe_paths): - yield from build.get_task_exe(exe_path) + """Build native libs""" + for build, lib_path in zip(builds, lib_paths): + yield from build.get_task_lib(lib_path) def task_c_obj(): |
