build: build libyaml as a shared module on Windows (#305)

The libyaml setup is currently configured improperly, not selecting
either shared nor static builds, resulting in libyaml being built
assuming that it is a user of libyaml, which is incorrect.  Adjust the
build to build libyaml as a shared library.

This change is not exactly precise, over generalizing the application of
the `YAML_DECLARE_EXPORT` to avoid bumping the minimum version of SPM to
5.4, which is the first version to include support for
`.platform(.windows)`.  This should not impact the other targets, as the
macro is not consulted for other targets.

This should allow us to enable testing on Windows again which was
disabled with #304.
This commit is contained in:
Saleem Abdulrasool 2021-03-22 08:51:34 -07:00 committed by GitHub
parent 9bb84f0566
commit 780e2ada77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ let package = Package(
.library(name: "Yams", targets: ["Yams"])
],
targets: [
.target(name: "CYaml"),
.target(name: "CYaml", cSettings: [.define("YAML_DECLARE_EXPORT")]),
.target(name: "Yams", dependencies: ["CYaml"]),
.testTarget(name: "YamsTests", dependencies: ["Yams"])
]