cmake: Introduce option EXPAT_GE to control macro XML_GE

This commit is contained in:
Sebastian Pipping 2023-10-26 00:59:52 +02:00
parent d285fafaca
commit daa89e42c0
3 changed files with 13 additions and 0 deletions

View file

@ -34,4 +34,5 @@ XML_ATTR_INFO
XML_CONTEXT_BYTES
XML_DEV_URANDOM
XML_DTD
XML_GE
XML_NS

View file

@ -143,6 +143,8 @@ expat_shy_set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much
mark_as_advanced(EXPAT_CONTEXT_BYTES)
expat_shy_set(EXPAT_DTD ON CACHE BOOL "Define to make parameter entity parsing functionality available")
mark_as_advanced(EXPAT_DTD)
expat_shy_set(EXPAT_GE ON CACHE BOOL "Define to make general entity parsing functionality available")
mark_as_advanced(EXPAT_GE)
expat_shy_set(EXPAT_NS ON CACHE BOOL "Define to make XML Namespaces functionality available")
mark_as_advanced(EXPAT_NS)
expat_shy_set(EXPAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "Treat all compiler warnings as errors")
@ -179,6 +181,11 @@ endif()
#
# Environment checks
#
if(EXPAT_DTD AND NOT EXPAT_GE)
message(SEND_ERROR "Option EXPAT_DTD requires that EXPAT_GE is also enabled.")
message(SEND_ERROR "Please either enable option EXPAT_GE (recommended) or disable EXPAT_DTD also.")
endif()
if(EXPAT_WITH_LIBBSD)
find_library(LIB_BSD NAMES bsd)
if(NOT LIB_BSD)
@ -281,6 +288,7 @@ endif()
_expat_copy_bool_int(EXPAT_ATTR_INFO XML_ATTR_INFO)
_expat_copy_bool_int(EXPAT_DTD XML_DTD)
_expat_copy_bool_int(EXPAT_GE XML_GE)
_expat_copy_bool_int(EXPAT_LARGE_SIZE XML_LARGE_SIZE)
_expat_copy_bool_int(EXPAT_MIN_SIZE XML_MIN_SIZE)
_expat_copy_bool_int(EXPAT_NS XML_NS)
@ -932,6 +940,7 @@ message(STATUS " // Advanced options, changes not advised")
message(STATUS " Attributes info .......... ${EXPAT_ATTR_INFO}")
message(STATUS " Context bytes ............ ${EXPAT_CONTEXT_BYTES}")
message(STATUS " DTD support .............. ${EXPAT_DTD}")
message(STATUS " General entities ......... ${EXPAT_GE}")
message(STATUS " Large size ............... ${EXPAT_LARGE_SIZE}")
message(STATUS " Minimum size ............. ${EXPAT_MIN_SIZE}")
message(STATUS " Namespace support ........ ${EXPAT_NS}")

View file

@ -105,6 +105,9 @@
/* Define to make parameter entity parsing functionality available. */
#cmakedefine XML_DTD
/* Define as 1/0 to enable/disable support for general entities. */
#define XML_GE @XML_GE@
/* Define to make XML Namespaces functionality available. */
#cmakedefine XML_NS