mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
Allow modules to specify defines
The modules.yaml now has an optional defines: list per module that adds preprocessor definitions to the build scripts. Also added a --debug flag to qemu.sh to run QEMU's debugger host.
This commit is contained in:
@@ -33,6 +33,7 @@ class Module:
|
|||||||
self.target = kwargs.get("target", None)
|
self.target = kwargs.get("target", None)
|
||||||
self.deps = kwargs.get("deps", tuple())
|
self.deps = kwargs.get("deps", tuple())
|
||||||
self.includes = kwargs.get("includes", tuple())
|
self.includes = kwargs.get("includes", tuple())
|
||||||
|
self.defines = kwargs.get("defines", tuple())
|
||||||
self.depmods = []
|
self.depmods = []
|
||||||
|
|
||||||
sources = [join(root, f) for f in kwargs.get("source", tuple())]
|
sources = [join(root, f) for f in kwargs.get("source", tuple())]
|
||||||
|
|||||||
8
qemu.sh
8
qemu.sh
@@ -1,5 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
debug=""
|
||||||
|
if [[ $1 = "--debug" ]]; then
|
||||||
|
debug="-s"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
build=${1:-"$(dirname $0)/build"}
|
build=${1:-"$(dirname $0)/build"}
|
||||||
|
|
||||||
kvm=""
|
kvm=""
|
||||||
@@ -19,4 +25,4 @@ exec qemu-system-x86_64 \
|
|||||||
-M q35 \
|
-M q35 \
|
||||||
-no-reboot \
|
-no-reboot \
|
||||||
-nographic \
|
-nographic \
|
||||||
$kvm
|
$kvm $debug
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ ccflags = $ccflags $
|
|||||||
{%- for inc in module.includes %}
|
{%- for inc in module.includes %}
|
||||||
-I${srcroot}/{{ inc }} $
|
-I${srcroot}/{{ inc }} $
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
{%- for define in module.defines %}
|
||||||
|
-D{{ define }} $
|
||||||
|
{%- endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% for source in module.sources %}
|
{% for source in module.sources %}
|
||||||
|
|||||||
Reference in New Issue
Block a user