From 20e573cfac2e20f4dcfea9b1a2c4968aff6b3bd4 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 28 Dec 2022 07:32:50 -0800 Subject: [PATCH] build: adopt static linking for Yams on Windows toolchain Windows now partially supports static linking of Swift libraries (non-swiftCore targets). Use this to enable static linking of Yams as there is a single user (swift-driver). This allows us to save ~256KB due to the internalisation. --- utils/build-windows-toolchain.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index cd99dc49f53a7..1cd195a01b698 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -450,6 +450,7 @@ cmake --build %BuildRoot%\9 --target install || (exit /b) cmake ^ -B %BuildRoot%\10 ^ + -D BUILD_SHARED_LIBS=NO ^ -D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^ -D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^ -D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy /DYAML_DECLARE_EXPORT /DWIN32" ^