diff --git a/SConstruct b/SConstruct deleted file mode 100644 index 01015552eba7b..0000000000000 --- a/SConstruct +++ /dev/null @@ -1 +0,0 @@ -Program('hello.cpp') diff --git a/setup.py b/setup.py index dba329f4d63a3..3ecfa17c6dca5 100644 --- a/setup.py +++ b/setup.py @@ -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', diff --git a/wscript b/wscript deleted file mode 100644 index e1e1ada702d33..0000000000000 --- a/wscript +++ /dev/null @@ -1,9 +0,0 @@ -# pylint: disable=missing-module-docstring,invalid-name - - -def configure(_ctx): - pass - - -def build(ctx): - ctx.exec_command('echo Hello, Waf for CODEQL !')