Skip to content

Commit c08fb37

Browse files
committed
This works around the MSVC headers reporting issues about the clang version. (Also requires VS 16.9 Preview 2)
*Corrected build scripts to allow VS pre-release versions. * Updated to CPPSharp 0.10.2 (NOTE: 0.10.3-0.10.5 have issues that trigger a dereference of NULL in native code)
1 parent a9b26a1 commit c08fb37

File tree

7 files changed

+16
-19
lines changed

7 files changed

+16
-19
lines changed

Build-All.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $oldPath = $env:Path
1111
try
1212
{
1313
. .\buildutils.ps1
14-
$buildInfo = Initialize-BuildEnvironment -FullInit
14+
$buildInfo = Initialize-BuildEnvironment -FullInit -AllowVsPreReleases:$AllowVsPreReleases
1515

1616
$BuildSource = $false
1717
$BuildDocs = $false;
@@ -33,12 +33,12 @@ try
3333

3434
if($BuildSource)
3535
{
36-
.\Build-Source.ps1
36+
.\Build-Source.ps1 -AllowVsPreReleases:$AllowVsPreReleases
3737
}
3838

3939
if($BuildDocs)
4040
{
41-
.\Build-Docs.ps1
41+
.\Build-Docs.ps1 -AllowVsPreReleases:$AllowVsPreReleases
4242
}
4343
}
4444
catch

Build-Interop.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $oldPath = $env:Path
4444
try
4545
{
4646
. .\buildutils.ps1
47-
$buildInfo = Initialize-BuildEnvironment
47+
$buildInfo = Initialize-BuildEnvironment -AllowVsPreReleases:$AllowVsPreReleases
4848

4949
# Download and unpack the LLVM libs if not already present, this doesn't use NuGet as the NuGet compression
5050
# is insufficient to keep the size reasonable enough to support posting to public galleries. Additionally, the

Build-Source.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $oldPath = $env:Path
88
try
99
{
1010
. .\buildutils.ps1
11-
$buildInfo = Initialize-BuildEnvironment
11+
$buildInfo = Initialize-BuildEnvironment -AllowVsPreReleases:$AllowVsPreReleases
1212

1313
$packProperties = @{ version=$($buildInfo['PackageVersion'])
1414
llvmversion=$($buildInfo['LlvmVersion'])
@@ -20,7 +20,7 @@ try
2020
LlvmVersion = $buildInfo['LlvmVersion']
2121
}
2222

23-
.\Build-Interop.ps1
23+
.\Build-Interop.ps1 -AllowVsPreReleases:$AllowVsPreReleases
2424

2525
$buildLogPath = Join-Path $buildInfo['BinLogsPath'] Ubiquity.NET.Llvm.binlog
2626
Write-Information "Building Ubiquity.NET.Llvm"

Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageReference Update="MSTest.TestFramework" Version="2.1.0" />
1414
<PackageReference Update="MSTest.TestAdapter" Version="2.1.0" />
1515
<PackageReference Update="System.Memory" Version="4.5.4" />
16-
<PackageReference Update="CppSharp" Version="0.10.1" />
16+
<PackageReference Update="CppSharp" Version="0.10.2" />
1717
<PackageReference Update="Antlr4" Version="4.6.6"/>
1818
<PackageReference Update="OpenSoftware.DgmlBuilder" Version="1.14.0" />
1919
<PackageReference Update="System.Collections.Immutable" Version="1.7.0" />

PsModules/CommonBuild/CommonBuild.psm1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,11 @@ function Find-VSInstance([switch]$PreRelease, $Version = '[15.0, 17.0)', [string
243243
Install-Module VSSetup -Scope CurrentUser -Force:$forceModuleInstall | Out-Null
244244
}
245245

246-
Get-VSSetupInstance -Prerelease:$PreRelease |
247-
Select-VSSetupInstance -Version $Version -Require $requiredComponents |
248-
select -First 1
246+
$vs = Get-VSSetupInstance -Prerelease:$PreRelease |
247+
Select-VSSetupInstance -Version $Version -Require $requiredComponents |
248+
select -Last 1
249+
250+
return $vs
249251
}
250252

251253
function Find-MSBuild([switch]$AllowVsPreReleases)

buildutils.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Initialize-BuildEnvironment
4949
{
5050
# support common parameters
5151
[cmdletbinding()]
52-
Param([switch]$FullInit)
52+
Param([switch]$FullInit, [switch]$AllowVsPreReleases)
5353

5454
# Script code should ALWAYS use the global CurrentBuildKind
5555
$currentBuildKind = Get-CurrentBuildKind
@@ -81,7 +81,7 @@ function Initialize-BuildEnvironment
8181
}
8282
}
8383

84-
$msbuildInfo = Find-MSBuild
84+
$msbuildInfo = Find-MSBuild -AllowVsPreReleases:$AllowVsPreReleases
8585
if( !$msbuildInfo['FoundOnPath'] )
8686
{
8787
$env:Path = "$env:Path;$($msbuildInfo['BinPath'])"

src/Interop/LlvmBindingsGenerator/bindingsConfig.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# - ...
1111
# ----
1212
# Some functions are exported, but not projected into Ubiquity.NET.Llvm.Interop.NativeMethods. While this may seem strange, it is
13-
# generally used only for dipose functions that are only used by the hadle wrappers. Exposing such APIs for random callers
14-
# would introduce undefined behavior that most likely results i hard to diagnose crashes. So, they have private PInvoke
13+
# generally used only for dipose functions that are only used by the handle wrappers. Exposing such APIs for random callers
14+
# would introduce undefined behavior that most likely results in hard to diagnose crashes. So, they have private PInvoke
1515
# signatures in the handle types themselves, but are ignored for generating the public NativeMethods API surface
1616
#
1717
# Marshaling Info has a base type and multiple derived types
@@ -1144,11 +1144,6 @@ AnonymousEnums:
11441144
LLVMAttributeReturnIndex: LLVMAttributeIndex
11451145
LLVMMDStringMetadataKind: LLVMMetadataKind
11461146

1147-
#IgnoredHeaders:
1148-
# - lto.h
1149-
# - LinkTimeOptimizer.h
1150-
# - OptRemarks.h
1151-
#
11521147
IgnoredHeaders:
11531148
- llvm-c/LinkTimeOptimizer.h
11541149
- llvm-c/lto.h

0 commit comments

Comments
 (0)