From 780e2ada77b5adc36854d34a476e51bb9906b1ff Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 22 Mar 2021 08:51:34 -0700 Subject: [PATCH] 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. --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 514750d..17b207e 100644 --- a/Package.swift +++ b/Package.swift @@ -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"]) ]