qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] add Visual Studio Code configuration


From: Paolo Bonzini
Subject: Re: [PATCH] add Visual Studio Code configuration
Date: Wed, 12 May 2021 20:29:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 12/05/21 13:02, Peter Maydell wrote:
--- /dev/null
+++ b/scripts/rebuild.py
@@ -0,0 +1,22 @@
+#! /usr/bin/env python3
+#
+# Author: Paolo Bonzini <pbonzini@redhat.com>
+#
+# This program compiles the input files using commands from the
+# compile_commands.json file.  (Unlike Make/ninja, the _source_
+# file is passed to the program rather than the targe).  It is
+# mostly intended to be called from editors.

This seems weird. I don't think we should try to support multiple
ways of building QEMU -- editors should just run make the same
way everybody else does...

Right, it's possible to include a "whole build" task in tasks.json, and it will invoke Make/ninja (I haven't done it yet though so it's not included in this first attempt).

This script instead is used to rebuild the one file that is being edited, for example to check quickly for syntax errors. I did find it quite surprising that VS Code could not do this on its own, since it can use compile_commands.json to retrieve the header file paths for example; still, this script is not a replacement for make, as this functionality of reverse-mapping from .c to .o is not available natively in either Make or ninja. It might even be handy for vim or Emacs users.

(This series really should have been tagged as RFC).

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]