This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modules: repair libxml2 link on Windows (#6)
We cannot simply explicitly spell out the linked library name in general. On Windows, the name of the library is determined by the library in use and selects across the following matrix: | | Debug | Release | | --- | --- | --- | | **Static** | `libxml2sd.lib` | `libxml2s.lib` | | **Dynamic** | `xml2d.lib` | `xml2.lib` | Note that this already assumes that the dynamic MSVC library (`/MD`) build is in use. The selection between `/MD` and `/MT` is not something that can be identified by the name. Accommodating this within the modulemap is not entirely reasonable. As a result, in order to maintain compatibility with the current behaviour, I've resorted to some module level inline assembly (simply to avoid adding a source file as there is no source file currently for the module). By hand constructing the linker directives for Linux and macOS, we can continue to have the autolinking behaviour which can support all the platforms. The alternative to all this mess would be to require the user to specify the location of the import library, DSO, or TBD (depending on the platform) manually when invoking the swift build tool.
- Loading branch information