Skip to content

Commit 577945d

Browse files
authored
Merge pull request #77624 from compnerd/lmdb
utils: adjust Windows build to use shared LMDB
2 parents 9a5d8cb + 5319f1e commit 577945d

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

utils/build.ps1

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,9 @@ enum HostComponent {
445445
PackageManager
446446
Markdown
447447
Format
448+
LMDB
448449
IndexStoreDB
449450
SourceKitLSP
450-
LMDB
451451
SymbolKit
452452
DocC
453453
SwiftInspect
@@ -2471,6 +2471,15 @@ function Test-Format {
24712471
}
24722472
}
24732473

2474+
function Build-LMDB($Arch) {
2475+
Build-CMakeProject `
2476+
-Src $SourceCache\swift-lmdb `
2477+
-Bin (Get-HostProjectBinaryCache LMDB) `
2478+
-Arch $Arch `
2479+
-UseMSVCCompilers C `
2480+
-BuildTargets default
2481+
}
2482+
24742483
function Build-IndexStoreDB($Arch) {
24752484
$SDKInstallRoot = (Get-HostSwiftSDK);
24762485

@@ -2486,6 +2495,7 @@ function Build-IndexStoreDB($Arch) {
24862495
BUILD_SHARED_LIBS = "NO";
24872496
CMAKE_C_FLAGS = @("-I$SDKInstallRoot\usr\include", "-I$SDKInstallRoot\usr\include\Block");
24882497
CMAKE_CXX_FLAGS = @("-I$SDKInstallRoot\usr\include", "-I$SDKInstallRoot\usr\include\Block");
2498+
LMDB_DIR = (Get-HostProjectCMakeModules LMDB);
24892499
}
24902500
}
24912501

@@ -2507,19 +2517,23 @@ function Build-SourceKitLSP($Arch) {
25072517
SwiftCrypto_DIR = (Get-HostProjectCMakeModules Crypto);
25082518
SwiftCollections_DIR = (Get-HostProjectCMakeModules Collections);
25092519
SwiftPM_DIR = (Get-HostProjectCMakeModules PackageManager);
2520+
LMDB_DIR = (Get-HostProjectCMakeModules LMDB);
25102521
IndexStoreDB_DIR = (Get-HostProjectCMakeModules IndexStoreDB);
25112522
}
25122523
}
25132524

25142525
function Test-SourceKitLSP {
25152526
$SwiftPMArguments = @(
2527+
# dispatch
2528+
"-Xcc", "-I$SourceCache\swift-corelibs-libdispatch",
2529+
"-Xcc", "-I$SourceCache\swift-corelibs-libdispatch\src\BlocksRuntime",
25162530
# swift-syntax
25172531
"-Xswiftc", "-I$(Get-HostProjectBinaryCache Compilers)\lib\swift\host",
25182532
"-Xswiftc", "-L$(Get-HostProjectBinaryCache Compilers)\lib\swift\host",
25192533
# swift-cmark
2520-
"-Xswiftc", "-I$($SourceCache)\cmark\src\include",
2521-
"-Xswiftc", "-I$($SourceCache)\cmark\extensions\include",
2522-
"-Xlinker", "-I$($SourceCache)\cmark\extensions\include",
2534+
"-Xswiftc", "-I$SourceCache\cmark\src\include",
2535+
"-Xswiftc", "-I$SourceCache\cmark\extensions\include",
2536+
"-Xlinker", "-I$SourceCache\cmark\extensions\include",
25232537
"-Xlinker", "$(Get-CMarkBinaryCache $HostArch)\src\cmark-gfm.lib",
25242538
"-Xlinker", "$(Get-CMarkBinaryCache $HostArch)\extensions\cmark-gfm-extensions.lib",
25252539
# swift-system
@@ -2560,6 +2574,8 @@ function Test-SourceKitLSP {
25602574
"-Xlinker", "$(Get-HostProjectBinaryCache IndexStoreDB)\lib\Index\Index.lib",
25612575
"-Xlinker", "$(Get-HostProjectBinaryCache IndexStoreDB)\lib\LLVMSupport\LLVMSupport.lib",
25622576
"-Xlinker", "$(Get-HostProjectBinaryCache IndexStoreDB)\lib\Support\Support.lib",
2577+
# LMDB
2578+
"-Xlinker", "$(Get-HostProjectBinaryCache LMDB)\lib\CLMDB.lib",
25632579
# sourcekit-lsp
25642580
"-Xswiftc", "-I$($SourceCache)\sourcekit-lsp\Sources\CAtomics\include",
25652581
"-Xswiftc", "-I$($SourceCache)\sourcekit-lsp\Sources\CSourcekitd\include",
@@ -2870,6 +2886,7 @@ if (-not $SkipBuild) {
28702886
Invoke-BuildStep Build-PackageManager $HostArch
28712887
Invoke-BuildStep Build-Markdown $HostArch
28722888
Invoke-BuildStep Build-Format $HostArch
2889+
Invoke-BuildStep Build-LMDB $HostArch
28732890
Invoke-BuildStep Build-IndexStoreDB $HostArch
28742891
Invoke-BuildStep Build-SourceKitLSP $HostArch
28752892
Invoke-BuildStep Build-Inspect $HostArch

0 commit comments

Comments
 (0)