Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Modules: repair libxml2 link on Windows #6

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Modules/libxml2-markup.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,31 @@
#include <libxml2/libxml/entities.h>
#include <libxml2/libxml/SAX.h>
#include <libxml2/libxml/SAX2.h>

#if defined(_WIN32)
# if defined(LIBXML_STATIC)
# if defined(LIBXML_DEBUG)
# pragma comment(lib, "libxml2sd.lib")
# else
# pragma comment(lib, "libxml2s.lib")
# endif
# else
# if defined(LIBXML_DEBUG)
# pragma comment(lib, "xml2d.lib")
# else
# pragma comment(lib, "xml2.lib")
# endif
# endif
#elif defined(__ELF__)
__asm__ (".section .swift1_autolink_entries,\"a\",@progbits\n"
".p2align 3\n"
".L_swift1_autolink_entries:\n"
" .asciz \"-lxml2\"\n"
" .size .L_swift1_autolink_entries, 7\n");
#elif defined(__wasm__)
#warning WASM autolinking not implemented
#else /* assume MachO */
__asm__ (".linker_option \"-lxml2\"\n");
#endif

#endif /* LIBXML2_MARKUP_H */
1 change: 0 additions & 1 deletion Modules/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module libxml2 [system] {
link "xml2"
umbrella header "libxml2-markup.h"
export *
module * { export * }
Expand Down