build: Only build xmlcatalog executable if enabled

This commit is contained in:
Nick Wellnhofer 2024-11-21 23:17:07 +01:00
parent a5764b56d2
commit 52afde07c1
3 changed files with 24 additions and 19 deletions

View File

@ -439,12 +439,11 @@ endif()
if(LIBXML2_WITH_PROGRAMS)
add_executable(xmllint xmllint.c shell.c)
add_executable(xmlcatalog xmlcatalog.c)
set(
PROGRAMS
xmlcatalog
xmllint
)
set(PROGRAMS xmllint)
if(LIBXML2_WITH_CATALOG AND LIBXML2_WITH_OUTPUT)
add_executable(xmlcatalog xmlcatalog.c)
list(APPEND PROGRAMS xmlcatalog)
endif()
foreach(PROGRAM ${PROGRAMS})
add_executable(LibXml2::${PROGRAM} ALIAS ${PROGRAM})
target_link_libraries(${PROGRAM} LibXml2)

View File

@ -26,7 +26,7 @@ check_PROGRAMS = \
testparser \
testrecurse
bin_PROGRAMS = xmllint xmlcatalog
bin_PROGRAMS = xmllint
bin_SCRIPTS = xml2-config
@ -48,6 +48,15 @@ if WITH_C14N_SOURCES
libxml2_la_SOURCES += c14n.c
endif
if WITH_CATALOG_SOURCES
if WITH_OUTPUT_SOURCES
bin_PROGRAMS += xmlcatalog
xmlcatalog_SOURCES = xmlcatalog.c
xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
xmlcatalog_DEPENDENCIES = $(DEPS)
xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
endif
libxml2_la_SOURCES += catalog.c
endif
if WITH_DEBUG_SOURCES
@ -138,11 +147,6 @@ xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
xmllint_DEPENDENCIES = $(DEPS)
xmllint_LDADD= $(RDL_LIBS) $(LDADDS)
xmlcatalog_SOURCES=xmlcatalog.c
xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
xmlcatalog_DEPENDENCIES = $(DEPS)
xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
testModule_SOURCES=testModule.c
testModule_DEPENDENCIES = $(DEPS)
testModule_LDADD= $(LDADDS)

View File

@ -484,13 +484,15 @@ executable(
## xmlcatalog tool
executable(
'xmlcatalog',
files('xmlcatalog.c'),
dependencies: [xml_dep, xmllint_deps],
include_directories: config_dir,
install: true,
)
if want_catalog and want_output
executable(
'xmlcatalog',
files('xmlcatalog.c'),
dependencies: [xml_dep, xmllint_deps],
include_directories: config_dir,
install: true,
)
endif
## testdso module