[all-commits] [llvm/llvm-project] ffe32b: [CMake] Add LIBXML2_DEFINITIONS when testing for s...

zero9178 via All-commits all-commits at lists.llvm.org
Sat Jul 24 00:55:36 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ffe32b5c71bfea0009e6d8d1788971d237709672
      https://github.com/llvm/llvm-project/commit/ffe32b5c71bfea0009e6d8d1788971d237709672
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2021-07-24 (Sat, 24 Jul 2021)

  Changed paths:
    M llvm/cmake/config-ix.cmake

  Log Message:
  -----------
  [CMake] Add LIBXML2_DEFINITIONS when testing for symbol existance

Currently when linking LLVM against Libxml2, a simple check is performed to check whether it can be linked successfully. This check currently adds the include directories and the libraries for libxml2, but not definitions found by the config.

This causes issues on Windows when trying to link against a static libxml2. Libxml2 requires LIBXML_STATIC to be defined in the preprocessor to be able to link statically. This definition is put into LIBXML2_DEFINITIONS in the cmake config, but not properly forwarded to check_symbol_exists leading to it failing as it could not find xmlReadMemory in a DLL.

This patch simply appends the content of LIBXML2_DEFINITIONS to the symbol check definitions, fixing the issue.

Differential Revision: https://reviews.llvm.org/D106740




More information about the All-commits mailing list