@@ -110,75 +110,16 @@ xml2_req = '>= @0@'.format(xml2_min_ver)
110
110
xml2_dep = dependency (
111
111
[' libxml-2.0' , ' LibXml2' ],
112
112
version : xml2_req,
113
- required : host_machine .system() != ' windows '
113
+ fallback : [ ' libxml2 ' ]
114
114
)
115
115
116
- # Setup CMake subproject for use, if needed
117
- if not xml2_dep.found()
118
- cmake = import (' cmake' )
119
- opt_var = cmake.subproject_options()
120
- build_shared = get_option (' default_library' ) != ' static'
121
- iconv_dep = dependency (' iconv' , required : false )
122
- icu_i18n_dep = dependency (' icu-i18n' , ' ICU' ,
123
- components : ' in' ,
124
- required : false )
125
- icu_uc_dep = dependency (' icu-uc' , ' ICU' ,
126
- components : ' uc' ,
127
- required : false )
128
- lzma_dep = dependency ([' liblzma' ,' LibLZMA' ], required : false )
129
- thread_dep = dependency (' threads' , required : false )
130
- zlib_dep = dependency (' zlib' , required : false )
131
- winsock_dep = cpp_compiler.find_library (' ws2_32' , required : false )
132
- bcrypt_dep = cpp_compiler.find_library (' bcrypt' , required : false )
133
- cmake_build_type = get_option (' buildtype' )
134
- if get_option (' buildtype' ) == ' debugoptimized'
135
- cmake_build_type = ' RelWithDebInfo'
136
- elif get_option (' buildtype' ) == ' minsize'
137
- cmake_build_type = ' MinSizeRel'
138
- elif get_option (' buildtype' ) == ' plain'
139
- cmake_build_type = ''
140
- endif
141
- opt_var.add_cmake_defines({
142
- ' BUILD_SHARED_LIBS' : build_shared,
143
- ' CMAKE_BUILD_TYPE' : cmake_build_type,
144
- ' CMAKE_MSVC_RUNTIME_LIBRARY' : '' ,
145
- ' CMAKE_C_FLAGS_INIT' : '' ,
146
- ' CMAKE_C_FLAGS_DEBUG' : '' ,
147
- ' CMAKE_C_FLAGS_RELEASE' : '' ,
148
- ' CMAKE_C_FLAGS_RELWITHDEBINFO' : '' ,
149
- ' CMAKE_C_FLAGS_MINSIZEREL' : '' ,
150
- ' LIBXML2_WITH_HTTP' : host_machine .system() != ' windows' or winsock_dep.found(),
151
- ' LIBXML2_WITH_ICONV' : iconv_dep.found(),
152
- ' LIBXML2_WITH_ICU' : icu_i18n_dep.found() and icu_uc_dep.found(),
153
- ' LIBXML2_WITH_LZMA' : lzma_dep.found(),
154
- ' LIBXML2_WITH_PYTHON' : false ,
155
- ' LIBXML2_WITH_TESTS' : build_tests,
156
- ' LIBXML2_WITH_THREADS' : thread_dep.found(),
157
- ' LIBXML2_WITH_ZLIB' : zlib_dep.found(),
158
- })
159
- xml2_sp = cmake.subproject (' libxml2_cmake' , options : opt_var)
160
- xml2_dep = xml2_sp.dependency (' LibXml2' )
161
- endif
162
-
163
- xml2_is_subproject = xml2_dep.type_name() == ' internal'
164
-
165
- if xml2_is_subproject and build_tests
166
- test (' testchar' , xml2_sp.target(' testchar' ))
167
- test (' testdict' , xml2_sp.target(' testdict' ))
168
- endif
169
-
170
116
xmlxx_requires = []
171
117
libxml2_lib_pkgconfig = ''
172
118
173
119
# Put libxml-2.0 in the 'Requires:' section in the generated pkg-config file if
174
120
# we found it by pkg-config
175
121
if xml2_dep.type_name() == ' pkgconfig'
176
122
xmlxx_requires += [' libxml-2.0' , xml2_req]
177
- else
178
- libxml2_lib_pkgconfig = xml2_dep.get_variable (
179
- cmake : ' LIBXML2_LIBRARIES' ,
180
- default_value : ' LibXml2.lib' ,
181
- )
182
123
endif
183
124
184
125
xmlxx_requires = ' ' .join(xmlxx_requires)
0 commit comments