endif()
endif()
+#
+# Configuration
+#
option(BUILD_tools "build the xmlwf tool for expat library" ${BUILD_tools_default})
option(BUILD_examples "build the examples for expat library" ON)
option(BUILD_tests "build the tests for expat library" ON)
option(BUILD_doc "build man page for xmlwf" ${BUILD_doc_default})
option(USE_libbsd "utilize libbsd (for arc4random_buf)" OFF)
option(INSTALL "install expat files in cmake install target" ON)
+set(XML_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
+option(XML_DTD "Define to make parameter entity parsing functionality available" ON)
+option(XML_NS "Define to make XML Namespaces functionality available" ON)
+option(WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
+if(NOT WIN32)
+ option(XML_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
+ set(USE_GETRANDOM "AUTO" CACHE STRING
+ "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
+ set(USE_SYS_GETRANDOM "AUTO" CACHE STRING
+ "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]")
+endif()
+option(XML_UNICODE "Use UTF-16 encoded chars (two bytes) instead of UTF-8" OFF)
+option(XML_UNICODE_WCHAR_T "Use wchar_t to represent UTF-16 instead of unsigned short" OFF)
+option(XML_ATTR_INFO "Define to allow retrieving the byte offsets for attribute names and values" OFF)
+if(MSVC)
+ set(MSVC_USE_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
+endif()
if(USE_libbsd)
find_library(LIB_BSD NAMES bsd)
endif()
endif()
-# configuration options
-set(XML_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
-option(XML_DTD "Define to make parameter entity parsing functionality available" ON)
-option(XML_NS "Define to make XML Namespaces functionality available" ON)
-option(WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
if(NOT WIN32)
- option(XML_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
if(XML_DEV_URANDOM)
set(XML_DEV_URANDOM 1)
else(XML_DEV_URANDOM)
set(XML_DEV_URANDOM 0)
endif(XML_DEV_URANDOM)
endif()
-if (NOT WIN32)
- set(USE_GETRANDOM "AUTO" CACHE STRING
- "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
- set(USE_SYS_GETRANDOM "AUTO" CACHE STRING
- "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]")
-endif()
-option(XML_UNICODE "Use UTF-16 encoded chars (two bytes) instead of UTF-8" OFF)
-option(XML_UNICODE_WCHAR_T "Use wchar_t to represent UTF-16 instead of unsigned short" OFF)
-option(XML_ATTR_INFO "Define to allow retrieving the byte offsets for attribute names and values" OFF)
if(XML_DTD)
set(XML_DTD 1)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")
-set(MSVC_USE_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
if (MSVC)
if (MSVC_USE_STATIC_CRT)
message("-- Using static CRT ${MSVC_USE_STATIC_CRT}")