Skip to content

Build: Add build of ASN1 and Certificates for SwiftPM #64087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2023
Merged
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
82 changes: 68 additions & 14 deletions utils/build-windows-toolchain.bat
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,61 @@ cmake ^
cmake --build %BuildRoot%\13 || (exit /b)
cmake --build %BuildRoot%\13 --target install || (exit /b)

:: Build swift-asn1
cmake ^
-B %BuildRoot%\14 ^

-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" ^
-D CMAKE_CXX_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
-D CMAKE_MT=mt ^
-D CMAKE_Swift_COMPILER=%BuildRoot%/1/bin/swiftc.exe ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^

-G Ninja ^
-S %SourceRoot%\swift-asn1 || (exit /b)
cmake --build %BuildRoot%\14 || (exit /b)
cmake --build %BuildRoot%\14 --target install || (exit /b)

:: Build swift-certificates
cmake ^
-B %BuildRoot%\15 ^

-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" ^
-D CMAKE_CXX_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
-D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^
-D CMAKE_MT=mt ^
-D CMAKE_Swift_COMPILER=%BuildRoot%/1/bin/swiftc.exe ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
-D SwiftCrypto_DIR=%BuildRoot%\12\cmake\modules ^
-D SwiftASN1_DIR=%BuildRoot%\14\cmake\modules ^

-G Ninja ^
-S %SourceRoot%\swift-certificates || (exit /b)
cmake --build %BuildRoot%\15 || (exit /b)
cmake --build %BuildRoot%\15 --target install || (exit /b)

:: Build swift-package-manager
cmake ^
-B %BuildRoot%\14 ^
-B %BuildRoot%\16 ^

-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
-D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
Expand All @@ -579,17 +631,19 @@ cmake ^
-D SwiftDriver_DIR=%BuildRoot%\11\cmake\modules ^
-D SwiftCrypto_DIR=%BuildRoot%\12\cmake\modules ^
-D SwiftCollections_DIR=%BuildRoot%\13\cmake\modules ^
-D SwiftASN1_DIR=%BuildRoot%\14\cmake\modules ^
-D SwiftCertificates_DIR=%BuildRoot%\15\cmake\modules ^
-D SQLite3_INCLUDE_DIR=%BuildRoot%\Library\sqlite-3.36.0\usr\include ^
-D SQLite3_LIBRARY=%BuildRoot%\Library\sqlite-3.36.0\usr\lib\SQLite3.lib ^

-G Ninja ^
-S %SourceRoot%\swiftpm || (exit /b)
cmake --build %BuildRoot%\14 || (exit /b)
cmake --build %BuildRoot%\14 --target install || (exit /b)
cmake --build %BuildRoot%\16 || (exit /b)
cmake --build %BuildRoot%\16 --target install || (exit /b)

:: Build IndexStoreDB
cmake ^
-B %BuildRoot%\15 ^
-B %BuildRoot%\17 ^

-D BUILD_SHARED_LIBS=NO ^
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
Expand All @@ -609,11 +663,11 @@ cmake ^

-G Ninja ^
-S %SourceRoot%\indexstore-db || (exit /b)
cmake --build %BuildRoot%\15 || (exit /b)
cmake --build %BuildRoot%\17 || (exit /b)

:: Build swift-syntax
cmake ^
-B %BuildRoot%\16 ^
-B %BuildRoot%\18 ^

-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
-D CMAKE_C_COMPILER=%BuildRoot%/1/bin/clang-cl.exe ^
Expand All @@ -627,12 +681,12 @@ cmake ^

-G Ninja ^
-S %SourceRoot%\swift-syntax || (exit /b)
cmake --build %BuildRoot%\16 || (exit /b)
cmake --build %BuildRoot%\16 --target install || (exit /b)
cmake --build %BuildRoot%\18 || (exit /b)
cmake --build %BuildRoot%\18 --target install || (exit /b)

:: Build SourceKit-LSP
cmake ^
-B %BuildRoot%\17 ^
-B %BuildRoot%\19 ^

-D BUILD_SHARED_LIBS=YES ^
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
Expand All @@ -654,15 +708,15 @@ cmake ^
-D LLBuild_DIR=%BuildRoot%\8\cmake\modules ^
-D ArgumentParser_DIR=%BuildRoot%\9\cmake\modules ^
-D Yams_DIR=%BuildRoot%\10\cmake\modules ^
-D SwiftPM_DIR=%BuildRoot%\14\cmake\modules ^
-D IndexStoreDB_DIR=%BuildRoot%\15\cmake\modules ^
-D SwiftPM_DIR=%BuildRoot%\16\cmake\modules ^
-D IndexStoreDB_DIR=%BuildRoot%\17\cmake\modules ^
-D SwiftCollections_DIR=%BuildRoot%\13\cmake\modules ^
-D SwiftSyntax_DIR=%BuildRoot%\16\cmake\modules ^
-D SwiftSyntax_DIR=%BuildRoot%\18\cmake\modules ^

-G Ninja ^
-S %SourceRoot%\sourcekit-lsp || (exit /b)
cmake --build %BuildRoot%\17 || (exit /b)
cmake --build %BuildRoot%\17 --target install || (exit /b)
cmake --build %BuildRoot%\19 || (exit /b)
cmake --build %BuildRoot%\19 --target install || (exit /b)

:: Create Configuration Files
python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'DEFAULT_USE_RUNTIME': 'MD' } }), encoding='utf-8'))" > %SDKInstallRoot%\SDKSettings.plist
Expand Down