readd --test option to build script

This commit is contained in:
flysand7 2023-08-26 16:52:59 +11:00
parent 967580d298
commit 45ae248539
1 changed files with 8 additions and 1 deletions

View File

@ -1,11 +1,17 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse
import importlib import importlib
import platform # Checking current OS import platform # Checking current OS
import os import os
import sys import sys
import re import re
arg_parser = argparse.ArgumentParser(description="Build ciabatta", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
arg_parser.add_argument("-t", "--test", help="Specify a file to compile with ciabatta")
args = vars(arg_parser.parse_args())
test_file = args['test']
class colors: class colors:
grey='\033[38;5;243m' grey='\033[38;5;243m'
@ -108,4 +114,5 @@ compile_obj('bin/cia.o', ['cia.c'])
archive('lib/cia.a', ['bin/cia.o', 'bin/thread-entry.o']) archive('lib/cia.a', ['bin/cia.o', 'bin/thread-entry.o'])
# Build the test # Build the test
compile_exe('a', ['tests/threaded.c', 'lib/cia.a'], ['-Wl,-dynamic-linker,lib/ld-cia.so']) if test_file != None:
compile_exe('a', [test_file, 'lib/cia.a'], ['-Wl,-dynamic-linker,lib/ld-cia.so'])