mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
qapi: Fix code generation for sub-modules in other directories
The #include directives to pull in sub-modules use file names relative
to the main module. Works only when all modules are in the same
directory, or the main module's output directory is in the compiler's
include path. Use relative file names instead.
The dummy variable we generate to avoid empty .o files has an invalid
name for sub-modules in other directories. Fix that.
Both messed up in commit 252dc3105f
"qapi: Generate separate .h, .c
for each module". Escaped testing because tests/qapi-schema-test.json
doesn't cover sub-modules in other directories, only
tests/qapi-schema/include-relpath.json does, and we generate and
compile C code only for the former, not the latter. Fold the latter
into the former. This would have caught the mistakes fixed in this
commit.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190301154051.23317-5-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
dddee4d7ba
commit
709395f8f6
13 changed files with 91 additions and 42 deletions
|
@ -1 +0,0 @@
|
|||
{ 'include': '../include-relpath-sub.json' }
|
5
tests/qapi-schema/include/sub-module.json
Normal file
5
tests/qapi-schema/include/sub-module.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
# *-*- Mode: Python -*-*
|
||||
|
||||
# Sub-module of ../qapi-schema-test.json
|
||||
|
||||
{ 'include': '../sub-sub-module.json' }
|
Loading…
Add table
Add a link
Reference in a new issue