Skip to content

Commit

Permalink
Delete experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidokert committed Jun 30, 2024
1 parent c968d0c commit 2b5738a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
1 change: 0 additions & 1 deletion SConstruct

This file was deleted.

37 changes: 34 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
# pylint: disable=missing-module-docstring
# pylint: disable=missing-module-docstring,missing-class-docstring
from setuptools import setup
from setuptools.command.build_py import build_py
import subprocess
import sys


def run_command(command, cwd=None):
"""Utility function to run a shell command and stream its output."""
try:
with subprocess.Popen(
command,
cwd=cwd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
bufsize=1) as process:
# Stream output in real-time
for line in process.stdout:
print(line, end='') # end='' to avoid double newlines
process.stdout.close()
return_code = process.wait()
if return_code:
raise subprocess.CalledProcessError(return_code, command)
except subprocess.CalledProcessError as e:
print('Command failed with return code', e.returncode)
sys.exit(1)


class CustomBuild(build_py):

def run(self):
# Place your custom build logic here
print('Running custom build steps')
super().run()

# Running GN to generate build files
print('Generating build files with GN...')
run_command(
['python', 'cobalt/build/gn.py', '-p', 'linux-x64x11', '-C', 'devel'])

# Running Ninja to build the project
print('Building project with Ninja...')
run_command(['ninja', '-C', 'out/linux-x64x11_devel'])


setup(
name='Cobalt',
Expand Down
9 changes: 0 additions & 9 deletions wscript

This file was deleted.

0 comments on commit 2b5738a

Please sign in to comment.