File tree 5 files changed +17
-8
lines changed
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)
883
883
# Find optional dependencies.
884
884
#
885
885
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 ()
892
891
893
892
# You need libedit linked in order to check if you have el_wgets.
894
893
cmake_push_check_state()
Original file line number Diff line number Diff line change @@ -172,6 +172,12 @@ foreach(SDK ${SWIFT_SDKS})
172
172
set (validation_test_bin_dir
173
173
"${CMAKE_CURRENT_BINARY_DIR} /../validation-test${VARIANT_SUFFIX} " )
174
174
175
+ if (LibXml2_FOUND)
176
+ set (SWIFT_HAVE_LIBXML2 TRUE )
177
+ else ()
178
+ set (SWIFT_HAVE_LIBXML2 FALSE )
179
+ endif ()
180
+
175
181
swift_configure_lit_site_cfg(
176
182
"${CMAKE_CURRENT_SOURCE_DIR} /lit.site.cfg.in"
177
183
"${test_bin_dir} /lit.site.cfg"
Original file line number Diff line number Diff line change 6
6
// RUN: %FileCheck %s -check-prefix=WRONG < %t.txt
7
7
8
8
// REQUIRES: no_asan
9
+ // REQUIRES: libxml2
9
10
// WRONG-NOT: CommentXMLInvalid
Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ if "@SWIFT_BUILD_SYNTAXPARSERLIB@" == "TRUE":
91
91
if "@SWIFT_ENABLE_SOURCEKIT_TESTS@" == "TRUE" :
92
92
config .available_features .add ('sourcekit' )
93
93
94
+ if "@SWIFT_HAVE_LIBXML2@" == "TRUE" :
95
+ config .available_features .add ('libxml2' )
96
+
94
97
if "@SWIFT_ENABLE_LLD_LINKER@" == "TRUE" :
95
98
config .android_linker_name = "lld"
96
99
else :
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ target_link_libraries(swift-ide-test
11
11
swiftIDE)
12
12
13
13
# If libxml2 is available, make it available for swift-ide-test.
14
- if (SWIFT_HAVE_LIBXML )
14
+ if (LibXml2_FOUND )
15
15
include_directories (SYSTEM ${LIBXML2_INCLUDE_DIR} )
16
16
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 )
18
18
endif ()
19
19
20
20
# Create a symlink for swift-api-dump.py in the bin directory
You can’t perform that action at this time.
0 commit comments