CMakeLists.txt


Log

Author Commit Date CI Message
Nick Wellnhofer 33a1f897 2024-06-16T19:16:47 legacy: Merge SAX.c into legacy.c
Nick Wellnhofer 1341deac 2024-06-16T17:57:12 xmllint: Move shell to xmllint Move source code for xmllint shell to shell.c and move it from the libxml2 library to the xmllint executable. Also allow shell to run without XPath and debug modules. Add stubs for old shell API functions in legacy build mode.
Nick Wellnhofer 481fd6bb 2024-06-16T16:30:54 tests: Remove testThreads.c This was merged into runtest.c some time ago.
Nick Wellnhofer b0fc67aa 2024-06-15T22:53:55 build: Remove --with-tree configuration option This option would allow for a smaller, but mostly useless minimal build. But it complicates the symbol availability logic in an insane way and requires specialized tools like our custom C parser in doc/apibuild.py. See #717.
Nick Wellnhofer 7cf7a54a 2024-06-15T22:27:40 build: Only enable linker version script in legacy mode The version script is deprecated but required for backward compatibility.
Nick Wellnhofer e714f506 2024-06-15T20:14:03 build: Stop installing libxml.m4 This file is deprecated and unmaintained. It will be kept in the source tree for a while.
Nick Wellnhofer 669bd349 2024-06-12T18:20:01 xpointer: Remove support for XPointer locations The latest spec for what it essentially an XPath extension seems to be this working draft from 2002: https://www.w3.org/TR/xptr-xpointer/ The xpointer() scheme is listed as "being reviewed" in the XPointer registry since at least 2006. libxml2 seems to be the only modern software that tries to implement this spec, but the code has many bugs and quality issues. If you configure --with-legacy, old symbols are retained for ABI compatibility.
Nick Wellnhofer dba1ed85 2024-06-12T18:19:55 ftp: Remove FTP support Remove the built-in FTP client. If you configure --with-legacy, old symbols are retained for ABI compatibility.
Nick Wellnhofer 11ce63f0 2024-05-21T20:38:52 build: Don't check for isascii
Nick Wellnhofer e80f27fc 2024-05-21T18:37:57 build: Don't check for inttypes.h This header isn't used.
Nick Wellnhofer 3018842c 2024-05-20T23:51:01 build: Disable HTTP support by default
Nick Wellnhofer 609d2666 2024-05-01T23:46:46 Stop defining _REENTRANT This macro is obsolete, see `man feature_test_macros`.
Nick Wellnhofer 1cdfece1 2024-04-28T18:33:40 memory: Remove memory debugging This is useless compared to sanitizers or valgrind and has a considerable performance impact if enabled accidentally.
Nick Wellnhofer 00336f0f 2024-04-20T20:54:41 cmake: Don't use tabs in CMakeLists.txt Always use spaces and indent_size=4 except for Makefiles.
Nick Wellnhofer f7f14537 2024-04-02T12:56:11 build: Disable support for compression libraries by default libxml2 has limited support for reading and writing compressed data with the help of zlib and liblzma which used to be enabled by default. This only works for files read from the file system and never worked with memory buffers. My guess is that this feature is virtually unused. In light of the recently discovered xz backdoor, it's a good time to disable these features by default to reduce attack surface and prepare for eventual removal. If --with-legacy is passed to the Autotools build, compression will be enabled by default as before.
Nick Wellnhofer 2e9e758d 2023-12-24T14:27:46 dict: Get random seed from system PRNG
Nick Wellnhofer cf6e58d6 2023-12-05T20:40:20 build: Disable compiler TLS by default The global struct is quite large (~700 bytes on 64-bit systems which will be allocated for each thread whether it uses libxml2 or not) and already close to the total size limit on some platforms. Disable compiler TLS by default.
Nick Wellnhofer e2ce828c 2023-11-28T16:51:06 cmake: Update config.h.cmake.in This should enable TLS and destructors.
Nick Wellnhofer 5cffba83 2023-11-28T15:34:28 Rework va_copy fallback va_copy is a macro, so it can be detected without a feature test. Fallback to __va_copy or memcpy.
Nick Wellnhofer 7d6969d9 2023-11-23T15:48:52 Remove Trio Trio is a rather old cross-platform printf library which was bundled with libxml2. It was needed for ancient pre-C99 systems without snprintf and should be safe to remove these days.
Nick Wellnhofer a9ada183 2023-10-22T13:56:55 tests: Start with testparser.c for extra tests Several issues require customized tests. Start with a test that push parses large documents. See #539.
Nick Wellnhofer 19161bab 2023-09-25T14:00:48 dict: Internal API to look up hash values
James Le Cuirot c7ff438b 2023-09-10T13:00:31 cmake: Only use pkg-config for .pc files, not for building binaries Using `pkg_check_modules(FOO IMPORTED_TARGET foo)` with `target_link_libraries()` leads to `INTERFACE_LINK_LIBRARIES` in the resulting export file having `\$<LINK_ONLY:PkgConfig::FOO>` rather than the currently expected `\$<LINK_ONLY:FOO::FOO>`, leading to breakage. This can be worked around like so: target_link_libraries(UseFoo PUBLIC "$<BUILD_INTERFACE:PkgConfig::FOO>" INTERFACE "$<INSTALL_INTERFACE:FOO::FOO>" ) However, following some discussion, it is preferable to primarily use find modules as before and only use `pkg_check_modules` for correctly populating the .pc file. Also move `find_package()` calls earlier so that builds fail faster when dependencies are missing.
James Le Cuirot 8617d8aa 2023-09-10T13:07:49 cmake: Find threads dep early as it may be needed for later checks
Nick Wellnhofer e7f0d88b 2023-09-21T01:38:26 build: Remove some GCC warnings -Wnested-externs produces spurious warnings after implicit declaration of functions. -Winline is useless since we don't use inlines. -Wredundant-decls was already removed for autotools.
James Le Cuirot f369154f 2023-09-03T22:14:01 cmake: Generate better pkg-config file for SYSROOT builds under CMake I recently fixed this for Autotools but said that fixing this for CMake was not feasible due to it using `find_package` rather than `pkg_check_modules`. I then thought about it and couldn't find any reason why CMake couldn't try `pkg_check_modules` first and then fall back to `find_package`, as that's basically what Autotools does. I had wanted to use the linker flags generated by CMake when it does fall back to `find_package`, but it only returns direct paths to the libraries, as opposed to `-l` flags. Baking these library paths into the pkg-config and xml2-config files would break static linking and cross-compiling, so I've stuck with the `-l` flags we already have. There is no need to set `CMAKE_REQUIRED_LIBRARIES` because we already add the dependencies to the library target.
James Le Cuirot 93e8bb2a 2023-09-02T17:12:58 build: Generate better pkg-config files for static-only builds pkg-config supports `Requires.private` and `Libs.private` fields for static linking. However, if you're building a dynamic binary, then pkg-config will use the non-private fields, even if just the static libxml2 is available. This will result in libxml2 being underlinked, causing the build to fail. The solution is to fold the private fields into the non-private fields when the shared libxml2 is not being built. This works for Autotools and CMake. Meson also knows how to handle this when it automatically generates pkg-config files.
James Le Cuirot 4640ccac 2023-09-02T16:18:30 build: Generate better pkg-config file for SYSROOT builds The -I and -L flags you use to build should not necessarily be the same ones you bake into installed files. If you are building with dependencies located under a SYSROOT then the installed files should have no knowledge of that SYSROOT. For example, if the build requires `-L/path/to/sysroot/usr/lib/foo` then only `-L/usr/lib/foo` should be baked into the installed files. pkg-config is SYSROOT-aware, so this issue can be sidestepped by using the `Requires` field rather than the `Libs` and `Cflags` fields. This is easily resolved if you rely solely on pkg-config, but this project falls back to standard Autoconf checks, so a little more effort is required. Unfortunately, this issue cannot feasibly be resolved for CMake. `find_package` is used rather than `pkg_check_modules`, so we cannot tell whether a pkg-config file for each dependency is present or not, even if `find_package` uses pkg-config behind the scenes. The CMake build does not record any dependency -I or -L flags into the pkg-config file anyway. This is a problem in itself, although these dependencies are most likely installed to standard locations. Meson is very much better at handling this, as it generates the pkg-config file automatically using the correct logic.
Nick Wellnhofer c5989473 2023-09-01T14:52:11 dict: Use thread-local storage for PRNG state
Nick Wellnhofer 57cfd221 2023-09-01T14:52:04 dict: Use xoroshiro64** as PRNG Stop using rand_r. This enables hash randomization on all platforms.
Nick Wellnhofer cb8ccb10 2023-05-25T03:07:57 testapi: Don't set http_proxy environment variable We already disable network access, so this has no effect.
Luca Niccoli fdc9cfaa 2023-04-30T13:02:31 cmake: Fix va_copy detection va_copy is defined by the standard as a macro, so check_function_exists will not detect it; check_symbol_exists will. Fixes #528.
Nick Wellnhofer a5bc4605 2023-04-29T20:43:54 cmake: Link with --undefined-version
Alexander Kutelev f931178e 2023-02-24T12:45:01 cmake: Link against `dl` and `dld` only when `LIBXML2_WITH_MODULES` is enabled
Nick Wellnhofer b92768cd 2022-12-08T00:24:53 tests: Enable "runsuite" test This enables some tests with testcases in - test/xsdtest - test/relaxng/OASIS/spectest.xml - test/relaxng/testsuite.xml The XML Schema Test Suite will also be run it was downloaded, see xstc/Makefile.am. Gitlab CI should be updated to fetch these files. There are 10 expected errors in the XSD test suite. This seems to be the case since at least version 2.9.0 from 2012.
Nick Wellnhofer 530938b4 2022-10-18T18:56:56 cmake: Build static library with -DLIBXML_STATIC Fix scope of target_compile_definitions command. Fixes #425.
Nick Wellnhofer 796c830a 2022-09-20T14:30:19 cmake: Set SOVERSION Fixes #410.
Nick Wellnhofer 5ff3baf0 2022-09-06T17:33:38 python: Create .pyd on Windows
Nick Wellnhofer a41878bd 2022-09-05T23:16:23 build: Remove check for broken ss_family This only seemed to affect ancient AIX systems.
Nick Wellnhofer 30c8d9bb 2022-09-05T02:02:54 http: Simplify IPv6 checks This should also enable IPv6 support on Windows. Untested and mostly useless anyway, since we don't support HTTPS.
Nick Wellnhofer 02e12371 2022-09-04T20:12:18 cmake: Fix Python installation Don't install into ${Python_SITEARCH} for now.
Nick Wellnhofer 243fdbc3 2022-09-04T19:13:14 cmake: Don't check for Python 2
Nick Wellnhofer fe02289f 2022-09-04T03:19:01 Remove arg cast configure checks We can simply cast to non-const char * unconditionally.
Nick Wellnhofer 1e60c768 2022-09-04T01:49:41 Remove HAVE_WIN32_THREADS configuration flag Check for LIBXML_THREAD_ENABLED and _WIN32 instead.
Nick Wellnhofer 202b8e19 2022-09-01T06:52:02 cmake: Enable GCC compiler warnings
Nick Wellnhofer caef8563 2022-09-02T17:26:47 Move automata test to runtest.c
Nick Wellnhofer 513d65fe 2022-09-02T16:45:06 Use AM_CFLAGS and AM_LDFLAGS consistently
Nick Wellnhofer 75bd98a5 2022-09-02T05:09:42 Remove unused code in nanohttp.c This was hidden behind an undocumented flag RES_USE_INET6.
Nick Wellnhofer 5bffa33a 2022-09-02T05:03:03 Stop including sys/types.h
Nick Wellnhofer 59f2f60e 2022-09-02T00:27:57 Remove "runtime debugging" This doesn't seem useful as configuration option.
Nick Wellnhofer 484efeb6 2022-08-23T20:07:39 cmake: Disable version script on macOS Fixes #400
Daniel E eab0ce8f 2022-07-13T21:47:37 cmake: Install libxml.m4 on UNIX-like platforms Install libxml.m4 to follow GNU Autotools more closely
Daniel E 88012a38 2022-07-13T21:02:50 cmake: Use symbol versioning on UNIX-like platforms Use symbol versioning to follow GNU Autotools more closely
Nick Wellnhofer 67070107 2022-04-20T23:17:14 Add configuration flag for XPointer locations support Add a new configuration flag that controls whether the outdated support for XPointer locations (ranges and points) is enabled. --with-xptr-locs # Autotools LIBXML2_WITH_XPTR_LOCS # CMake The latest spec for what it essentially an XPath extension seems to be this working draft from 2002: https://www.w3.org/TR/xptr-xpointer/ The xpointer() scheme is listed as "being reviewed" in the XPointer registry since at least 2006. libxml2 seems to be the only modern software that tries to implement this spec, but the code has many bugs and quality issues. The flag defaults to "off" and support for this extensions has to be requested explicitly. The relevant API functions are deprecated.
Nick Wellnhofer 02709d0f 2022-04-20T19:18:17 Remove remaining definitions of STDC_HEADERS Sync with Autotools build.
Nick Wellnhofer 270eb712 2022-04-20T14:04:04 cmake: Run all tests when threads are disabled
Nick Wellnhofer 18bcced9 2022-04-20T13:36:02 cmake: Fix build with thread support Move configure_file(config.h) below pthreads check. Fix regression caused by commit f5659a1.
Nick Wellnhofer 776b0028 2022-04-13T16:46:58 cmake: Disable FTP and legacy modules by default Sync with Autotools build.
Nick Wellnhofer f5659a12 2022-04-13T14:30:54 cmake: Fix build without thread support Only check for pthread.h if threads are enabled. Fixes #367.
Nick Wellnhofer a5724a3b 2022-04-08T15:46:26 cmake: Install documentation in CMAKE_INSTALL_DOCDIR Sync with recent Autotools change.
Daniel E 4d98f6f9 2022-04-08T12:11:39 cmake: Remove more unnecessary files installed in docs dir Sync with commit 95766541622b3a66c929e2e272b0252750d0174d Don't install man pages in docs directory, these are already installed in the correct path and while at it sort list
Nick Wellnhofer 94ac5e61 2022-04-07T02:05:41 CMakeLists.txt: Fix LIBXML_VERSION_NUMBER Also fix LIBXML_VERSION and remove LIBXML_VERSION_STRING. Fixes #365.
Daniel E f2987a29 2022-04-03T18:49:19 cmake: Remove non needed files in docs dir Don't install files that are used to generate the documentation
Nick Wellnhofer 5ce893c0 2020-07-09T03:21:07 Move regexp tests to runtest
Nick Wellnhofer 48b03c84 2022-04-03T20:36:38 Remove major parts of old test suite Remove all the parts of the old test suite which are covered by runtest.c for quite some time. The following test programs are removed: - testC14N - testHTML - testReader - testRelax - testSAX - testSchemas - testURI - testXPath This also removes a few results of unimportant tests only run by the old test suite.
Nick Wellnhofer 4b10e7cf 2022-04-03T18:44:37 Remove outdated xml2Conf.sh
Nick Wellnhofer 61b78b0a 2022-04-03T18:30:26 Consolidate man pages Move xml2-config.1 into doc directory. Remove outdated libxml.3.
Nick Wellnhofer cf6cd81c 2022-04-03T02:18:25 Add WIN32_EXTRA_LIBADD to XML_PRIVATE_LIBS
Daniel Engberg 6d10df7c 2022-04-02T22:23:44 cmake: Adjust paths for UNIX or UNIX-like target systems Sync paths with GNU Autotools
David Seifert 5c71ada8 2022-03-30T16:51:17 Detect libm using libtool's macros
David Seifert 865520f0 2022-03-30T00:32:35 Respect `--sysconfdir` in source files * Prefix installations need to point to a non-root `etc` - Gentoo Prefix has been patching this for over 10 years: https://bugs.gentoo.org/317891 - MacPorts has to manually replace paths after patching: https://github.com/macports/macports-ports/blob/cc3bb736e906abe73b014da02a89ae2b70ef6295/textproc/libxml2/Portfile#L46
Nick Wellnhofer 4a8c71eb 2022-03-04T03:35:57 Remove DOCBparser This code has been broken and deprecated since version 2.6.0, released in 2003. Because of a bug in commit 961b535c, DOCBparser.c was never compiled since 2012. I couldn't find a Debian package using any of its symbols, so it seems safe to remove this module.
Nick Wellnhofer 21ddad52 2022-03-04T01:07:40 Remove ICONV_CONST test We can simply cast the offending pointer to (void *).
Nick Wellnhofer 72119afe 2022-03-02T01:14:08 Don't check for standard C89 library functions Don't check for - fprintf - localtime - printf - rand - sprintf - srand - sscanf - strftime - time - vfprintf - vsprintf If the C99 functions snprintf and vsnprintf are missing, Trio is enabled.
Nick Wellnhofer 776d15d3 2022-03-02T00:29:17 Don't check for standard C89 headers Don't check for - ctype.h - errno.h - float.h - limits.h - math.h - signal.h - stdarg.h - stdlib.h - string.h - time.h Stop including non-standard headers - malloc.h - strings.h
Nick Wellnhofer b041d829 2022-02-16T19:55:30 Remove xmlwin32version.h This file was undocumented and never used anywhere. Maybe users were supposed to rename this file to xmlversion.h manually. These days, both CMake and win32/configure.js generate xmlversion.h from xmlversion.h.in, just like the Autotools build.
Nick Wellnhofer 10891111 2022-02-13T22:52:53 Redirect links to xmlsoft.org Documentation and releases are now available on gitlab.gnome.org.
Ben Boeckel 51c88c6f 2021-07-26T20:12:45 configure: remove unused checks for functions Nothing uses the results from these checks, so remove the checks. There are some "uses" in order to suppress macro shadowing in MSVC's implementation of `isinf` and `isnan` as macros, but those are hard-coded and do not require checks to manage.
Ben Boeckel 1a013ba7 2021-07-26T20:11:56 configure: remove unused checks for libraries These libraries are queried for, but no code cares about the results, so remove the checks.
Ben Boeckel 0aad075c 2021-07-26T20:10:52 cmake: remove unused checks Even the configured `config.h` did not forward the results of these checks.
Ben Boeckel 9669bd68 2021-07-26T20:09:32 configure: remove unused checks for headers These headers are checked for at configure time, but the code never cares about the results of these checks, so skip them.
Ben Boeckel f8608235 2021-07-26T20:06:18 cmake: fix `ATTRIBUTE_DESTRUCTOR` definition The code expects it to be set to the attribute for `xmlDestructor`, but in CMake, it is only ever available as `1` or undefined. Instead, match the behavior or autoconf.
Timothy Lyanguzov 22f15211 2021-06-04T09:57:46 Use version in configure.ac for CMake Now CMake script reads version from configure.ac to prevent unsynchronized versions
Markus Rickert a46e85f6 2021-05-22T15:20:46 Update CMake project version
Markus Rickert a1cac3bb 2021-05-22T14:51:26 Add CMake alias targets for embedded projects
Christopher Degawa d3a02679 2021-03-15T13:44:34 CMake: Only add postfixes if MSVC Currently, it catches mingw-w64 in there as well, but mingw-w64 follows linux-like naming with no weird postfixes Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Markus Rickert 88c657d6 2021-02-22T21:11:00 Use CMake PROJECT_VERSION
Markus Rickert f93ca3e1 2021-01-15T17:53:27 Update minimum required CMake version
Markus Rickert 26835480 2020-12-30T14:28:24 Fix ICU build in CMake
Markus Rickert 296ab61e 2020-11-19T22:06:36 Configure pkgconfig, xml2-config, and xml2Conf.sh file
Markus Rickert d0ccb3a6 2020-12-06T17:25:52 Add xmlcatalog and xmllint to CMake export
Markus Rickert 1c4f9a6d 2020-11-25T18:01:51 Require dependencies based on enabled CMake options
Markus Rickert 8272db53 2020-11-28T22:54:40 Use NAMELINK_COMPONENT in CMake install
Markus Rickert 7a62870a 2020-11-19T22:06:23 Add missing compile definition for static builds to CMake
Markus Rickert d514e2bd 2020-07-12T18:42:49 Set project language to C
Markus Rickert 5ddf02f2 2020-06-07T16:06:17 Update config.h.cmake.in
Markus Rickert 8bec210d 2020-06-04T17:37:21 Add variable for working directory of XML Conformance Test Suite
Markus Rickert 270e1655 2020-06-04T14:45:48 Add additional tests and XML Conformance Test Suite
Markus Rickert e6ba4bd7 2020-06-04T11:58:04 Add command line option for temp directory in runtest
Markus Rickert 9ecf5ad6 2020-06-04T00:16:15 Enable runtests and testThreads