build: introduce WITH_JSON

Some tests depend on WITH_YAJL even though the actual library used
does not make a difference. Introduce WITH_JSON for a smoother
transition.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko 2024-09-04 16:02:16 +02:00
parent 8eba36d4b1
commit dcb7cfd149
4 changed files with 7 additions and 6 deletions

View File

@ -1414,6 +1414,7 @@ if yajl_dep.found()
endif endif
conf.set('WITH_YAJL', 1) conf.set('WITH_YAJL', 1)
conf.set('WITH_JSON', 1)
endif endif

View File

@ -329,7 +329,7 @@ if host_machine.system() == 'linux'
{ 'name': 'virscsitest' }, { 'name': 'virscsitest' },
{ 'name': 'virusbtest' }, { 'name': 'virusbtest' },
] ]
if conf.has('WITH_YAJL') if conf.has('WITH_JSON')
tests += [ tests += [
{ 'name': 'virnetdevopenvswitchtest' }, { 'name': 'virnetdevopenvswitchtest' },
] ]
@ -406,7 +406,7 @@ if conf.has('WITH_NETWORK')
] ]
endif endif
if conf.has('WITH_NODE_DEVICES') and conf.has('WITH_YAJL') if conf.has('WITH_NODE_DEVICES') and conf.has('WITH_JSON')
tests += [ tests += [
{ 'name': 'nodedevmdevctltest', 'link_with': [ node_device_driver_impl ] }, { 'name': 'nodedevmdevctltest', 'link_with': [ node_device_driver_impl ] },
] ]
@ -555,7 +555,7 @@ if conf.has('WITH_VMX')
] ]
endif endif
if conf.has('WITH_YAJL') if conf.has('WITH_JSON')
tests += [ tests += [
{ 'name': 'virjsontest' }, { 'name': 'virjsontest' },
{ 'name': 'virmacmaptest' }, { 'name': 'virmacmaptest' },

View File

@ -26,7 +26,7 @@
#define VIR_FROM_THIS VIR_FROM_RPC #define VIR_FROM_THIS VIR_FROM_RPC
#if !defined(WIN32) && defined(WITH_YAJL) #if !defined(WIN32) && defined(WITH_JSON)
struct testClientPriv { struct testClientPriv {
int magic; int magic;
}; };

View File

@ -815,7 +815,7 @@ mymain(void)
" <host name='example.org' port='1234'/>\n" " <host name='example.org' port='1234'/>\n"
"</source>\n", 1); "</source>\n", 1);
#ifdef WITH_YAJL #ifdef WITH_JSON
TEST_BACKING_PARSE("json:", NULL); TEST_BACKING_PARSE("json:", NULL);
TEST_BACKING_PARSE("json:asdgsdfg", NULL); TEST_BACKING_PARSE("json:asdgsdfg", NULL);
TEST_BACKING_PARSE("json:{}", NULL); TEST_BACKING_PARSE("json:{}", NULL);
@ -1192,7 +1192,7 @@ mymain(void)
" <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>\n" " <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>\n"
"</source>\n"); "</source>\n");
#endif /* WITH_YAJL */ #endif /* WITH_JSON */
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
} }