diff --git a/.github/workflows/data/expat_config_h_cmake__expected.txt b/.github/workflows/data/expat_config_h_cmake__expected.txt index ea291955..9e8910b0 100644 --- a/.github/workflows/data/expat_config_h_cmake__expected.txt +++ b/.github/workflows/data/expat_config_h_cmake__expected.txt @@ -34,4 +34,5 @@ XML_ATTR_INFO XML_CONTEXT_BYTES XML_DEV_URANDOM XML_DTD +XML_GE XML_NS diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index 325a4a72..38805ebb 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -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}") diff --git a/expat/expat_config.h.cmake b/expat/expat_config.h.cmake index a290fafb..ceb9b4ec 100644 --- a/expat/expat_config.h.cmake +++ b/expat/expat_config.h.cmake @@ -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