[BUILD] Fix build test generation for Linux systems

This allows a Linux system to generate all the PPC tests just by running ./xb gentests as on a Windows system. Tested locally.
This commit is contained in:
Marco Rodolfi 2025-01-11 17:54:09 +01:00 committed by Radosław Gliński
parent 09be7e874a
commit 1822bca890
1 changed files with 15 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import re
import shutil
import subprocess
import sys
import stat
__author__ = 'ben.vanik@gmail.com (Ben Vanik)'
@ -1279,12 +1280,25 @@ class GenTestsCommand(Command):
print('Generating test binaries...')
print('')
binutils_path = os.path.join('third_party', 'binutils-ppc-cygwin')
if sys.platform == 'win32':
binutils_path = os.path.join('third_party', 'binutils-ppc-cygwin')
else:
binutils_path = os.path.join('third_party', 'binutils', 'bin')
ppc_as = os.path.join(binutils_path, 'powerpc-none-elf-as')
ppc_ld = os.path.join(binutils_path, 'powerpc-none-elf-ld')
ppc_objdump = os.path.join(binutils_path, 'powerpc-none-elf-objdump')
ppc_nm = os.path.join(binutils_path, 'powerpc-none-elf-nm')
if not os.path.exists(ppc_as) and sys.platform == 'linux':
print('Binaries are missing, binutils build required')
print('')
shell_script = os.path.join('third_party', 'binutils', 'build.sh')
# Set executable bit for build script before running it
os.chmod(shell_script, stat.S_IRUSR | stat.S_IWUSR |
stat.S_IXUSR | stat.S_IRGRP | stat.S_IROTH)
shell_call([shell_script])
test_src = os.path.join('src', 'xenia', 'cpu', 'ppc', 'testing')
test_bin = os.path.join(test_src, 'bin')