From 5cbb51975eb35283aacf06f28419cd37998f32fb Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Tue, 17 Jan 2023 20:48:09 +0200 Subject: [PATCH] Add VSCode build task (#16) Former-commit-id: a8f8ef18e51b7cb57df8e819f016efd65e1e1154 --- .vscode/tasks.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ configure.py | 5 +++++ 2 files changed, 49 insertions(+) create mode 100644 .vscode/tasks.json diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..6da70938 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,44 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "ninja", + "type": "shell", + "command": "ninja", + "group": { + "kind": "build", + "isDefault": false + } + }, + { + "label": "all_source", + "type": "shell", + "command": "ninja all_source", + "group": "build", + "problemMatcher": [] + }, + { + "label": "all_source_host", + "type": "shell", + "command": "ninja all_source_host", + "problemMatcher": { + "base": "$gcc" + }, + "group": "build" + }, + { + "label": "current file (host)", + "type": "shell", + "command": "ninja host/${relativeFile}", + "problemMatcher": { + "base": "$gcc" + }, + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} diff --git a/configure.py b/configure.py index dbb18217..bb6af526 100755 --- a/configure.py +++ b/configure.py @@ -1373,6 +1373,11 @@ if __name__ == "__main__": "basefile": f"$builddir/src/{object}", }, ) + n.build( + outputs=f"host/{c_file}", + rule="phony", + inputs=f"$builddir/host/{object}.o", + ) if add_to_all: all_host_source_files.append(f"$builddir/host/{object}.o") if add_to_all: