]> Git Repo - qemu.git/commit - tests/.gitignore
qapi: Fix code generation for sub-modules in other directories
authorMarkus Armbruster <[email protected]>
Fri, 1 Mar 2019 15:40:48 +0000 (16:40 +0100)
committerMarkus Armbruster <[email protected]>
Tue, 5 Mar 2019 13:43:11 +0000 (14:43 +0100)
commit709395f8f627808175307f0c298ce71614fa67d0
tree6b4741f70ae41f46617e9e5c34dfa7e6e346028a
parentdddee4d7ba3c0992a32f805c02cb612775dfba54
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 252dc3105fc "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 <[email protected]>
Message-Id: <20190301154051[email protected]>
Reviewed-by: Eric Blake <[email protected]>
13 files changed:
scripts/qapi/common.py
tests/.gitignore
tests/Makefile.include
tests/qapi-schema/include-relpath-sub.json [deleted file]
tests/qapi-schema/include-relpath.err [deleted file]
tests/qapi-schema/include-relpath.exit [deleted file]
tests/qapi-schema/include-relpath.json [deleted file]
tests/qapi-schema/include-relpath.out [deleted file]
tests/qapi-schema/include/relpath.json [deleted file]
tests/qapi-schema/include/sub-module.json [new file with mode: 0644]
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/qapi-schema/sub-sub-module.json [new file with mode: 0644]
This page took 0.029095 seconds and 4 git commands to generate.