From 14ae8680e34d86749db684318ea930eea42b8df1 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 5 Sep 2025 16:43:34 +0500 Subject: [PATCH] Fix find_package libxml compilation for more recent versions Noticed compiling against libxml2 2.13.8 package that it's trying to use dynamic libs by default if `LIBXML_STATIC` is not defined. Adding `LIBXML2_DEFINITIONS` helps. --- cmake/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index f9a60cbed3..9d0ce25005 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1028,6 +1028,9 @@ set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES}) add_library(IfcParse ${IFCPARSE_FILES}) set_target_properties(IfcParse PROPERTIES COMPILE_FLAGS -DIFC_PARSE_EXPORTS VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +if(LibXml2_DIR) + target_compile_definitions(IfcParse PRIVATE ${LIBXML2_DEFINITIONS}) +endif() if(WASM_BUILD) target_link_libraries(IfcParse ${BCRYPT_LIBRARIES} ${LIBXML2_LIBRARIES}) else()