Skip to content

Commit

Permalink
Merge pull request #483 from tannergooding/libclang-17
Browse files Browse the repository at this point in the history
Regenerating bindings for libclang v17.0.4
  • Loading branch information
tannergooding authored Nov 5, 2023
2 parents dc69728 + ebdd725 commit 0720817
Show file tree
Hide file tree
Showing 213 changed files with 568 additions and 2,447 deletions.
24 changes: 2 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,6 @@ jobs:
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
windows-x86:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
architecture: [ x86 ]
configuration: [ debug, release ]
os: [ windows ]
steps:
- uses: actions/checkout@v3
- run: ./scripts/cibuild.cmd -configuration ${{ matrix.configuration }} -architecture ${{ matrix.architecture }} /p:PlatformTarget=${{ matrix.architecture }}
shell: cmd
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
linux-x64:
runs-on: ${{ matrix.os }}-latest
strategy:
Expand Down Expand Up @@ -173,7 +153,7 @@ jobs:
publish-nightlies-azure:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
needs: [ windows-x64, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
steps:
- uses: actions/download-artifact@v3
with:
Expand All @@ -189,7 +169,7 @@ jobs:
publish-nightlies-github:
runs-on: ubuntu-latest
if: false
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
needs: [ windows-x64, linux-x64, macos-x64, sign-nuget-preview, sign-nuget-release ]
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.13)

project(ClangSharp VERSION 16.0.6)
project(ClangSharp VERSION 17.0.4)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Expand Down
13 changes: 1 addition & 12 deletions ClangSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{2F80
scripts\build.sh = scripts\build.sh
scripts\cibuild.cmd = scripts\cibuild.cmd
scripts\cibuild.sh = scripts\cibuild.sh
scripts\SignClientFileList.txt = scripts\SignClientFileList.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packages", "packages", "{AE6CF12F-5CC3-463B-A74B-6CCAE26EE4EF}"
Expand Down Expand Up @@ -86,11 +87,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libclang.runtime.win-x64",
packages\libclang\libclang.runtime.win-x64\libclang.runtime.win-x64.nuspec = packages\libclang\libclang.runtime.win-x64\libclang.runtime.win-x64.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libclang.runtime.win-x86", "libclang.runtime.win-x86", "{98BDA79D-8D81-4381-B794-65BAF82349D4}"
ProjectSection(SolutionItems) = preProject
packages\libclang\libclang.runtime.win-x86\libclang.runtime.win-x86.nuspec = packages\libclang\libclang.runtime.win-x86\libclang.runtime.win-x86.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp", "libClangSharp", "{EDEC2130-DA14-4415-91A3-225733FB61F8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp", "libClangSharp", "{B043C50D-8B06-4663-943A-DEBB6CFACEA6}"
Expand All @@ -114,11 +110,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp.runtime.win-x
packages\libClangSharp\libClangSharp.runtime.win-x64\libClangSharp.runtime.win-x64.nuspec = packages\libClangSharp\libClangSharp.runtime.win-x64\libClangSharp.runtime.win-x64.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp.runtime.win-x86", "libClangSharp.runtime.win-x86", "{6DF42BA2-F962-4BFC-9444-D0FD53D022B0}"
ProjectSection(SolutionItems) = preProject
packages\libClangSharp\libClangSharp.runtime.win-x86\libClangSharp.runtime.win-x86.nuspec = packages\libClangSharp\libClangSharp.runtime.win-x86\libClangSharp.runtime.win-x86.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libClangSharp", "libClangSharp", "{520C1055-34A1-4C72-AC24-023F84EF461D}"
ProjectSection(SolutionItems) = preProject
sources\libClangSharp\CIndexDiagnostic.cpp = sources\libClangSharp\CIndexDiagnostic.cpp
Expand Down Expand Up @@ -224,13 +215,11 @@ Global
{7D89072F-8E3E-4009-BCCD-5D3C69F88042} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
{8006B5D7-5E0E-4A0A-884F-62C5216144EE} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
{4A298C7E-BF4D-418D-B70D-FE6D6F8097FD} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
{98BDA79D-8D81-4381-B794-65BAF82349D4} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
{EDEC2130-DA14-4415-91A3-225733FB61F8} = {AE6CF12F-5CC3-463B-A74B-6CCAE26EE4EF}
{B043C50D-8B06-4663-943A-DEBB6CFACEA6} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
{4F2F7171-202E-4E23-AABF-EB3501BDB0B2} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
{C2BE41E6-95E9-431A-9C49-923BD50692AB} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
{C1218464-0B5A-480E-BA13-2C6EA370987E} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
{6DF42BA2-F962-4BFC-9444-D0FD53D022B0} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
{520C1055-34A1-4C72-AC24-023F84EF461D} = {732BA761-B58E-4C34-9C96-097382A55A7A}
{B3F3A831-DA09-40A2-A25C-DE47A58BB93B} = {DFACF682-2673-4AE1-8F10-816D025C2D45}
{69B805C6-230D-49A2-A569-3CAC2EC9F293} = {EDEC2130-DA14-4415-91A3-225733FB61F8}
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
<ContinuousIntegrationBuild Condition="'$(GITHUB_RUN_ID)' != ''">true</ContinuousIntegrationBuild>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<PackageOutputPath>$(BaseArtifactsPath)pkg/$(Configuration)/</PackageOutputPath>
<PackageValidationBaselineVersion>16.0.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>17.0.0</PackageValidationBaselineVersion>
<Product>ClangSharp</Product>
<RootNamespace>ClangSharp</RootNamespace>
<VersionPrefix>16.0.1</VersionPrefix>
<VersionPrefix>17.0.0</VersionPrefix>
<VersionSuffix Condition="'$(EXCLUDE_SUFFIX_FROM_VERSION)' != 'true'">rc1</VersionSuffix>
<VersionSuffix Condition="'$(GITHUB_EVENT_NAME)' == 'pull_request'">pr</VersionSuffix>
</PropertyGroup>
Expand Down
10 changes: 4 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@

<!-- Package versions for package references across all projects -->
<ItemGroup>
<PackageVersion Include="libClang" Version="16.0.6" />
<PackageVersion Include="libClangSharp" Version="16.0.6" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="libClang" Version="17.0.4" />
<PackageVersion Include="libClangSharp" Version="17.0.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta3.22114.1" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
</ItemGroup>

</Project>
55 changes: 35 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A convenience package which provides the native libClang library for several pla

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

**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).
**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).

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

Expand Down Expand Up @@ -71,45 +71,60 @@ You can see any additional options that are available by passing `-help` on Wind
ClangSharp provides a helper library, `libClangSharp`, that exposes additional functionality that is not available in `libClang`.
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.

To succesfully build `libClangSharp` you must first build Clang (https://clang.llvm.org/get_started.html). The process done on Windows is roughly:
To successfully build `libClangSharp` you must first build Clang (https://clang.llvm.org/get_started.html).

#### Windows

The process done on Windows is roughly:
```cmd
git clone --single-branch --branch llvmorg-16.0.6 https://github.com/llvm/llvm-project
git clone --single-branch --branch llvmorg-17.0.4 https://github.com/llvm/llvm-project
cd llvm-project
mkdir artifacts/bin
cd artifacts/bin
cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_INSTALL_PREFIX=../install -G "Visual Studio 16 2019" -A x64 -Thost=x64 ../../llvm
cmake -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 17 2022" -A x64 -Thost=x64 ../../llvm
```

You can then open `LLVM.sln` in Visual Studio, change the configuration to `Release` and build the `install` project.

Afterwards, you can then build `libClangSharp` where the process followed is roughly:
```cmd
git clone https://github.com/dotnet/clangsharp
cd clangsharp
mkdir artifacts/bin/native
cd artifacts/bin/native
cmake -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install/ -G "Visual Studio 16 2019" -A x64 -Thost=x64 ../../..
cmake -DCMAKE_INSTALL_PREFIX=../install -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install -G "Visual Studio 17 2022" -A x64 -Thost=x64 ../../..
```

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

If you building on Linux
```
git clone https://github.com/dotnet/clangsharp
cd clangsharp
mkdir artifacts/bin/native
cd artifacts/bin/native
cmake -DPATH_TO_LLVM=/usr/lib/llvm/14/ ../../..
make
```
#### Linux

or if you prefer Ninja
The process done on Linux is roughly:
```bash
git clone --single-branch --branch llvmorg-17.0.4 https://github.com/llvm/llvm-project
cd llvm-project
mkdir -p artifacts/bin
cd artifacts/bin
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS=clang ../../llvm
make install
```

If you want your Linux build to be portable, you may also consider specifying the following options:
* `-DLLVM_ENABLE_TERMINFO=OFF`
* `-DLLVM_ENABLE_ZLIB=OFF`
* `-DLLVM_ENABLE_ZSTD=OFF`
* `-DLLVM_STATIC_LINK_CXX_STDLIB=ON`

If you would prefer to use `Ninja`, then make sure to pass in `-G Ninja` and then invoke `ninja` rather than `make install`.

Afterwards, you can then build `libClangSharp` where the process followed is roughly:
```cmd
git clone https://github.com/dotnet/clangsharp
cd clangsharp
mkdir artifacts/bin/native
mkdir -p artifacts/bin/native
cd artifacts/bin/native
cmake -DPATH_TO_LLVM=/usr/lib/llvm/14/ -G Ninja ../../..
ninja
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install
make install
```

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

The simplest and recommended setup is to install the generator as a .NET tool and then use response files:
```
dotnet tool install --global ClangSharpPInvokeGenerator --version 16.0.0
dotnet tool install --global ClangSharpPInvokeGenerator --version 17.0.0
ClangSharpPInvokeGenerator @generate.rsp
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.linux-arm64</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.linux-x64</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.osx-arm64</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.osx-x64</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.win-arm64</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.win-x64</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion packages/libClangSharp/libClangSharp/libClangSharp.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
17 changes: 6 additions & 11 deletions packages/libClangSharp/libClangSharp/runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,32 @@
"runtimes": {
"linux-arm64": {
"libClangSharp": {
"libClangSharp.runtime.linux-arm64": "16.0.6"
"libClangSharp.runtime.linux-arm64": "17.0.4"
}
},
"linux-x64": {
"libClangSharp": {
"libClangSharp.runtime.linux-x64": "16.0.6"
"libClangSharp.runtime.linux-x64": "17.0.4"
}
},
"osx-arm64": {
"libClangSharp": {
"libClangSharp.runtime.osx-arm64": "16.0.6"
"libClangSharp.runtime.osx-arm64": "17.0.4"
}
},
"osx-x64": {
"libClangSharp": {
"libClangSharp.runtime.osx-x64": "16.0.6"
"libClangSharp.runtime.osx-x64": "17.0.4"
}
},
"win-arm64": {
"libClangSharp": {
"libClangSharp.runtime.win-arm64": "16.0.6"
"libClangSharp.runtime.win-arm64": "17.0.4"
}
},
"win-x64": {
"libClangSharp": {
"libClangSharp.runtime.win-x64": "16.0.6"
}
},
"win-x86": {
"libClangSharp": {
"libClangSharp.runtime.win-x86": "16.0.6"
"libClangSharp.runtime.win-x64": "17.0.4"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libclang.runtime.linux-arm64</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="expression">Apache-2.0 WITH LLVM-exception</license>
<projectUrl>https://github.com/dotnet/clangsharp</projectUrl>
<description>linux arm64 native library for libclang.</description>
<copyright>Copyright © LLVM Project</copyright>
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-16.0.6" />
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-17.0.4" />
</metadata>
<files>
<file src="..\libclang\LICENSE.TXT" target="LICENSE.TXT" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libclang.runtime.linux-x64</id>
<version>16.0.6</version>
<version>17.0.4</version>
<authors>.NET Foundation and Contributors</authors>
<owners>.NET Foundation and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="expression">Apache-2.0 WITH LLVM-exception</license>
<projectUrl>https://github.com/dotnet/clangsharp</projectUrl>
<description>linux x64 native library for libclang.</description>
<copyright>Copyright © LLVM Project</copyright>
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-16.0.6" />
<repository type="git" url="https://github.com/llvm/llvm-project" branch="llvmorg-17.0.4" />
</metadata>
<files>
<file src="..\libclang\LICENSE.TXT" target="LICENSE.TXT" />
Expand Down
Loading

0 comments on commit 0720817

Please sign in to comment.