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.
This commit is contained in:
Andrej730
2025-09-05 16:43:34 +05:00
parent 9ec0732a84
commit 14ae8680e3
+3
View File
@@ -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()