File tree Expand file tree Collapse file tree 5 files changed +17
-8
lines changed
Expand file tree Collapse file tree 5 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -883,12 +883,11 @@ find_package(PythonInterp REQUIRED)
883883# Find optional dependencies.
884884#
885885
886- # Find libxml.
887- # FIXME: unify with CLANG_HAVE_LIBXML, which is set in LLVM anyway.
888- find_package (LibXml2)
889- option (SWIFT_HAVE_LIBXML
890- "Whether to build with libxml"
891- ${LIBXML2_FOUND} )
886+ if (LLVM_ENABLE_LIBXML2)
887+ find_package (Libxml2 REQUIRED)
888+ else ()
889+ find_package (LibXml2)
890+ endif ()
892891
893892# You need libedit linked in order to check if you have el_wgets.
894893cmake_push_check_state()
Original file line number Diff line number Diff line change @@ -172,6 +172,12 @@ foreach(SDK ${SWIFT_SDKS})
172172 set (validation_test_bin_dir
173173 "${CMAKE_CURRENT_BINARY_DIR} /../validation-test${VARIANT_SUFFIX} " )
174174
175+ if (LibXml2_FOUND)
176+ set (SWIFT_HAVE_LIBXML2 TRUE )
177+ else ()
178+ set (SWIFT_HAVE_LIBXML2 FALSE )
179+ endif ()
180+
175181 swift_configure_lit_site_cfg(
176182 "${CMAKE_CURRENT_SOURCE_DIR} /lit.site.cfg.in"
177183 "${test_bin_dir} /lit.site.cfg"
Original file line number Diff line number Diff line change 66// RUN: %FileCheck %s -check-prefix=WRONG < %t.txt
77
88// REQUIRES: no_asan
9+ // REQUIRES: libxml2
910// WRONG-NOT: CommentXMLInvalid
Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ if "@SWIFT_BUILD_SYNTAXPARSERLIB@" == "TRUE":
9191if "@SWIFT_ENABLE_SOURCEKIT_TESTS@" == "TRUE" :
9292 config .available_features .add ('sourcekit' )
9393
94+ if "@SWIFT_HAVE_LIBXML2@" == "TRUE" :
95+ config .available_features .add ('libxml2' )
96+
9497if "@SWIFT_ENABLE_LLD_LINKER@" == "TRUE" :
9598 config .android_linker_name = "lld"
9699else :
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ target_link_libraries(swift-ide-test
1111 swiftIDE)
1212
1313# If libxml2 is available, make it available for swift-ide-test.
14- if (SWIFT_HAVE_LIBXML )
14+ if (LibXml2_FOUND )
1515 include_directories (SYSTEM ${LIBXML2_INCLUDE_DIR} )
1616 target_link_libraries (swift-ide-test PRIVATE ${LIBXML2_LIBRARIES} )
17- add_definitions (-DSWIFT_HAVE_LIBXML= "1" )
17+ target_compile_definitions (swift-ide- test PRIVATE SWIFT_HAVE_LIBXML=1 )
1818endif ()
1919
2020# Create a symlink for swift-api-dump.py in the bin directory
You can’t perform that action at this time.
0 commit comments