Skip to content

Commit 0720817

Browse files
Merge pull request #483 from tannergooding/libclang-17
Regenerating bindings for libclang v17.0.4
2 parents dc69728 + ebdd725 commit 0720817

File tree

213 files changed

+568
-2447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+568
-2447
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,6 @@ jobs:
2828
./artifacts/pkg/**/*
2929
./artifacts/tst/**/*
3030
if-no-files-found: error
31-
windows-x86:
32-
runs-on: ${{ matrix.os }}-latest
33-
strategy:
34-
matrix:
35-
architecture: [ x86 ]
36-
configuration: [ debug, release ]
37-
os: [ windows ]
38-
steps:
39-
- uses: actions/checkout@v3
40-
- run: ./scripts/cibuild.cmd -configuration ${{ matrix.configuration }} -architecture ${{ matrix.architecture }} /p:PlatformTarget=${{ matrix.architecture }}
41-
shell: cmd
42-
- uses: actions/upload-artifact@v3
43-
with:
44-
name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
45-
path: |
46-
./artifacts/bin/**/*
47-
./artifacts/log/**/*
48-
./artifacts/pkg/**/*
49-
./artifacts/tst/**/*
50-
if-no-files-found: error
5131
linux-x64:
5232
runs-on: ${{ matrix.os }}-latest
5333
strategy:
@@ -173,7 +153,7 @@ jobs:
173153
publish-nightlies-azure:
174154
runs-on: ubuntu-latest
175155
if: ${{ github.event_name == 'push' }}
176-
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
156+
needs: [ windows-x64, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
177157
steps:
178158
- uses: actions/download-artifact@v3
179159
with:
@@ -189,7 +169,7 @@ jobs:
189169
publish-nightlies-github:
190170
runs-on: ubuntu-latest
191171
if: false
192-
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
172+
needs: [ windows-x64, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
193173
steps:
194174
- uses: actions/download-artifact@v3
195175
with:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.13)
22

3-
project(ClangSharp VERSION 16.0.6)
3+
project(ClangSharp VERSION 17.0.4)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

ClangSharp.sln

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{2F80
5858
scripts\build.sh = scripts\build.sh
5959
scripts\cibuild.cmd = scripts\cibuild.cmd
6060
scripts\cibuild.sh = scripts\cibuild.sh
61+
scripts\SignClientFileList.txt = scripts\SignClientFileList.txt
6162
EndProjectSection
6263
EndProject
6364
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packages", "packages", "{AE6CF12F-5CC3-463B-A74B-6CCAE26EE4EF}"
@@ -86,11 +87,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libclang.runtime.win-x64",
8687
packages\libclang\libclang.runtime.win-x64\libclang.runtime.win-x64.nuspec = packages\libclang\libclang.runtime.win-x64\libclang.runtime.win-x64.nuspec
8788
EndProjectSection
8889
EndProject
89-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libclang.runtime.win-x86", "libclang.runtime.win-x86", "{98BDA79D-8D81-4381-B794-65BAF82349D4}"
90-
ProjectSection(SolutionItems) = preProject
91-
packages\libclang\libclang.runtime.win-x86\libclang.runtime.win-x86.nuspec = packages\libclang\libclang.runtime.win-x86\libclang.runtime.win-x86.nuspec
92-
EndProjectSection
93-
EndProject
9490
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp", "libClangSharp", "{EDEC2130-DA14-4415-91A3-225733FB61F8}"
9591
EndProject
9692
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp", "libClangSharp", "{B043C50D-8B06-4663-943A-DEBB6CFACEA6}"
@@ -114,11 +110,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp.runtime.win-x
114110
packages\libClangSharp\libClangSharp.runtime.win-x64\libClangSharp.runtime.win-x64.nuspec = packages\libClangSharp\libClangSharp.runtime.win-x64\libClangSharp.runtime.win-x64.nuspec
115111
EndProjectSection
116112
EndProject
117-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp.runtime.win-x86", "libClangSharp.runtime.win-x86", "{6DF42BA2-F962-4BFC-9444-D0FD53D022B0}"
118-
ProjectSection(SolutionItems) = preProject
119-
packages\libClangSharp\libClangSharp.runtime.win-x86\libClangSharp.runtime.win-x86.nuspec = packages\libClangSharp\libClangSharp.runtime.win-x86\libClangSharp.runtime.win-x86.nuspec
120-
EndProjectSection
121-
EndProject
122113
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp", "libClangSharp", "{520C1055-34A1-4C72-AC24-023F84EF461D}"
123114
ProjectSection(SolutionItems) = preProject
124115
sources\libClangSharp\CIndexDiagnostic.cpp = sources\libClangSharp\CIndexDiagnostic.cpp
@@ -224,13 +215,11 @@ Global
224215
{7D89072F-8E3E-4009-BCCD-5D3C69F88042} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
225216
{8006B5D7-5E0E-4A0A-884F-62C5216144EE} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
226217
{4A298C7E-BF4D-418D-B70D-FE6D6F8097FD} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
227-
{98BDA79D-8D81-4381-B794-65BAF82349D4} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
228218
{EDEC2130-DA14-4415-91A3-225733FB61F8} = {AE6CF12F-5CC3-463B-A74B-6CCAE26EE4EF}
229219
{B043C50D-8B06-4663-943A-DEBB6CFACEA6} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
230220
{4F2F7171-202E-4E23-AABF-EB3501BDB0B2} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
231221
{C2BE41E6-95E9-431A-9C49-923BD50692AB} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
232222
{C1218464-0B5A-480E-BA13-2C6EA370987E} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
233-
{6DF42BA2-F962-4BFC-9444-D0FD53D022B0} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
234223
{520C1055-34A1-4C72-AC24-023F84EF461D} = {732BA761-B58E-4C34-9C96-097382A55A7A}
235224
{B3F3A831-DA09-40A2-A25C-DE47A58BB93B} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
236225
{69B805C6-230D-49A2-A569-3CAC2EC9F293} = {EDEC2130-DA14-4415-91A3-225733FB61F8}

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
<ContinuousIntegrationBuild Condition="'$(GITHUB_RUN_ID)' != ''">true</ContinuousIntegrationBuild>
4545
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
4646
<PackageOutputPath>$(BaseArtifactsPath)pkg/$(Configuration)/</PackageOutputPath>
47-
<PackageValidationBaselineVersion>16.0.0</PackageValidationBaselineVersion>
47+
<PackageValidationBaselineVersion>17.0.0</PackageValidationBaselineVersion>
4848
<Product>ClangSharp</Product>
4949
<RootNamespace>ClangSharp</RootNamespace>
50-
<VersionPrefix>16.0.1</VersionPrefix>
50+
<VersionPrefix>17.0.0</VersionPrefix>
5151
<VersionSuffix Condition="'$(EXCLUDE_SUFFIX_FROM_VERSION)' != 'true'">rc1</VersionSuffix>
5252
<VersionSuffix Condition="'$(GITHUB_EVENT_NAME)' == 'pull_request'">pr</VersionSuffix>
5353
</PropertyGroup>

Directory.Packages.props

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212

1313
<!-- Package versions for package references across all projects -->
1414
<ItemGroup>
15-
<PackageVersion Include="libClang" Version="16.0.6" />
16-
<PackageVersion Include="libClangSharp" Version="16.0.6" />
17-
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
18-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
19-
<PackageVersion Include="NUnit" Version="3.13.3" />
15+
<PackageVersion Include="libClang" Version="17.0.4" />
16+
<PackageVersion Include="libClangSharp" Version="17.0.4" />
17+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
18+
<PackageVersion Include="NUnit" Version="3.14.0" />
2019
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
2120
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta3.22114.1" />
22-
<PackageVersion Include="System.Memory" Version="4.5.5" />
2321
</ItemGroup>
2422

2523
</Project>

README.md

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A convenience package which provides the native libClang library for several pla
1313

1414
A helper package which exposes many Clang APIs missing from libClang is provided here: https://www.nuget.org/packages/libClangSharp
1515

16-
**NOTE:** libclang and libClangSharp are meta-packages which point to the platform-specific runtime packages ([e.g.](https://www.nuget.org/packages/libClangSharp.runtime.win-x64/16.0.6); see others owned by [tannergooding](https://www.nuget.org/profiles/tannergooding)). Several manual steps may be required to use them, see discussion in [#46](https://github.com/dotnet/ClangSharp/issues/46) and [#118](https://github.com/dotnet/ClangSharp/issues/118).
16+
**NOTE:** libclang and libClangSharp are meta-packages which point to the platform-specific runtime packages ([e.g.](https://www.nuget.org/packages/libClangSharp.runtime.win-x64/17.0.4); see others owned by [tannergooding](https://www.nuget.org/profiles/tannergooding)). Several manual steps may be required to use them, see discussion in [#46](https://github.com/dotnet/ClangSharp/issues/46) and [#118](https://github.com/dotnet/ClangSharp/issues/118).
1717

1818
Nightly packages are available via the NuGet Feed URL: https://pkgs.clangsharp.dev/index.json
1919

@@ -71,45 +71,60 @@ You can see any additional options that are available by passing `-help` on Wind
7171
ClangSharp provides a helper library, `libClangSharp`, that exposes additional functionality that is not available in `libClang`.
7272
Building this requires [CMake 3.13 or later](https://cmake.org/download/) as well as a version of MSVC or Clang that supports C++ 17.
7373

74-
To succesfully build `libClangSharp` you must first build Clang (https://clang.llvm.org/get_started.html). The process done on Windows is roughly:
74+
To successfully build `libClangSharp` you must first build Clang (https://clang.llvm.org/get_started.html).
75+
76+
#### Windows
77+
78+
The process done on Windows is roughly:
7579
```cmd
76-
git clone --single-branch --branch llvmorg-16.0.6 https://github.com/llvm/llvm-project
80+
git clone --single-branch --branch llvmorg-17.0.4 https://github.com/llvm/llvm-project
7781
cd llvm-project
7882
mkdir artifacts/bin
7983
cd artifacts/bin
80-
cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_INSTALL_PREFIX=../install -G "Visual Studio 16 2019" -A x64 -Thost=x64 ../../llvm
84+
cmake -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 17 2022" -A x64 -Thost=x64 ../../llvm
8185
```
8286

8387
You can then open `LLVM.sln` in Visual Studio, change the configuration to `Release` and build the `install` project.
88+
8489
Afterwards, you can then build `libClangSharp` where the process followed is roughly:
8590
```cmd
8691
git clone https://github.com/dotnet/clangsharp
8792
cd clangsharp
8893
mkdir artifacts/bin/native
8994
cd artifacts/bin/native
90-
cmake -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install/ -G "Visual Studio 16 2019" -A x64 -Thost=x64 ../../..
95+
cmake -DCMAKE_INSTALL_PREFIX=../install -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install -G "Visual Studio 17 2022" -A x64 -Thost=x64 ../../..
9196
```
9297

93-
You can then open `libClangSharp.sln` in Visual Studio, change the configuration to `Release` and build the `ALL_BUILD` project.
98+
You can then open `libClangSharp.sln` in Visual Studio, change the configuration to `Release` and build the `install` project.
9499

95-
If you building on Linux
96-
```
97-
git clone https://github.com/dotnet/clangsharp
98-
cd clangsharp
99-
mkdir artifacts/bin/native
100-
cd artifacts/bin/native
101-
cmake -DPATH_TO_LLVM=/usr/lib/llvm/14/ ../../..
102-
make
103-
```
100+
#### Linux
104101

105-
or if you prefer Ninja
102+
The process done on Linux is roughly:
103+
```bash
104+
git clone --single-branch --branch llvmorg-17.0.4 https://github.com/llvm/llvm-project
105+
cd llvm-project
106+
mkdir -p artifacts/bin
107+
cd artifacts/bin
108+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS=clang ../../llvm
109+
make install
106110
```
111+
112+
If you want your Linux build to be portable, you may also consider specifying the following options:
113+
* `-DLLVM_ENABLE_TERMINFO=OFF`
114+
* `-DLLVM_ENABLE_ZLIB=OFF`
115+
* `-DLLVM_ENABLE_ZSTD=OFF`
116+
* `-DLLVM_STATIC_LINK_CXX_STDLIB=ON`
117+
118+
If you would prefer to use `Ninja`, then make sure to pass in `-G Ninja` and then invoke `ninja` rather than `make install`.
119+
120+
Afterwards, you can then build `libClangSharp` where the process followed is roughly:
121+
```cmd
107122
git clone https://github.com/dotnet/clangsharp
108123
cd clangsharp
109-
mkdir artifacts/bin/native
124+
mkdir -p artifacts/bin/native
110125
cd artifacts/bin/native
111-
cmake -DPATH_TO_LLVM=/usr/lib/llvm/14/ -G Ninja ../../..
112-
ninja
126+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install
127+
make install
113128
```
114129

115130
### Generating Bindings
@@ -118,7 +133,7 @@ This program will take a given set of C or C++ header files and generate C# bind
118133

119134
The simplest and recommended setup is to install the generator as a .NET tool and then use response files:
120135
```
121-
dotnet tool install --global ClangSharpPInvokeGenerator --version 16.0.0
136+
dotnet tool install --global ClangSharpPInvokeGenerator --version 17.0.0
122137
ClangSharpPInvokeGenerator @generate.rsp
123138
```
124139

packages/libClangSharp/libClangSharp.runtime.linux-arm64/libClangSharp.runtime.linux-arm64.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.linux-arm64</id>
5-
<version>16.0.6</version>
5+
<version>17.0.4</version>
66
<authors>.NET Foundation and Contributors</authors>
77
<owners>.NET Foundation and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>

packages/libClangSharp/libClangSharp.runtime.linux-x64/libClangSharp.runtime.linux-x64.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.linux-x64</id>
5-
<version>16.0.6</version>
5+
<version>17.0.4</version>
66
<authors>.NET Foundation and Contributors</authors>
77
<owners>.NET Foundation and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>

packages/libClangSharp/libClangSharp.runtime.osx-arm64/libClangSharp.runtime.osx-arm64.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.osx-arm64</id>
5-
<version>16.0.6</version>
5+
<version>17.0.4</version>
66
<authors>.NET Foundation and Contributors</authors>
77
<owners>.NET Foundation and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>

packages/libClangSharp/libClangSharp.runtime.osx-x64/libClangSharp.runtime.osx-x64.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata minClientVersion="2.12">
44
<id>libClangSharp.runtime.osx-x64</id>
5-
<version>16.0.6</version>
5+
<version>17.0.4</version>
66
<authors>.NET Foundation and Contributors</authors>
77
<owners>.NET Foundation and Contributors</owners>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>

0 commit comments

Comments
 (0)