Skip to content

Commit 80eb364

Browse files
radekdoulikakoeplinger
authored andcommitted
Build libclang, add it to nuget, add python bindings (llvm#149)
Context: dotnet/runtime#62485 * Build clang, add it to nuget, add python bindings * Disable few clang options for quicker build * Fix nuget props on OSX and linux The clang libs are already in the lib directory * Change build timeout, do not build clang on arm The windows/x64 build now takes around 120 minutes so increase the timeout to 140 minutes. We don't build mono/wasm on arm so we don't need to build clang for arm targets. * Add libclang.dll to non-arm nuget's only
1 parent 0f10ab4 commit 80eb364

4 files changed

+11
-0
lines changed

llvm.proj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@
6464
<ItemGroup>
6565
<_LLVMBuildArgs Condition="'$(BuildOS)' == 'Linux'" Include='-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--build-id' />
6666
</ItemGroup>
67+
<ItemGroup Condition="'$(TargetArchitecture)' != 'arm' and '$(TargetArchitecture)' != 'arm64'">
68+
<_LLVMBuildArgs Include='-DLLVM_ENABLE_PROJECTS=clang' />
69+
<_LLVMBuildArgs Include='-DCLANG_BUILD_TOOLS:BOOL=OFF' />
70+
<_LLVMBuildArgs Include='-DCLANG_INCLUDE_TESTS:BOOL=OFF' />
71+
<_LLVMBuildArgs Include='-DCLANG_ENABLE_ARCMT:BOOL=OFF' />
72+
<_LLVMBuildArgs Include='-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=OFF' />
73+
</ItemGroup>
6774

6875
<PropertyGroup Condition="'$(BuildOS)' != 'Windows_NT'">
6976
<_CrossCFlags Condition="'$(BuildOS)' == 'Linux' and '$(TargetArchitecture)' == 'arm64'">--target=aarch64-linux-gnu --sysroot=$(ROOTFS_DIR)</_CrossCFlags>

nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Linux.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<ItemGroup>
4+
<File Include="$(ProjectDir)\clang\bindings\python\clang\**" TargetPath="bindings\python\clang\" />
45
<File Include="$(_LLVMInstallDir)\bin\llvm-config" TargetPath="tools\$(PackageTargetRuntime)\bin\" />
56
<File Include="$(_LLVMInstallDir)\bin\llvm-dis" TargetPath="tools\$(PackageTargetRuntime)\bin\" />
67
<File Include="$(_LLVMInstallDir)\bin\llvm-tblgen" TargetPath="tools\$(PackageTargetRuntime)\bin\" />

nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.OSX.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<ItemGroup>
4+
<File Include="$(ProjectDir)\clang\bindings\python\clang\**" TargetPath="bindings\python\clang\" />
45
<File Include="$(_LLVMInstallDir)\bin\llvm-config" TargetPath="tools\$(PackageTargetRuntime)\bin\" />
56
<File Include="$(_LLVMInstallDir)\bin\llvm-dis" TargetPath="tools\$(PackageTargetRuntime)\bin\" />
67
<File Include="$(_LLVMInstallDir)\bin\llvm-tblgen" TargetPath="tools\$(PackageTargetRuntime)\bin\" />

nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Windows_NT.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<ItemGroup>
4+
<File Include="$(ProjectDir)\clang\bindings\python\clang\**" TargetPath="bindings\python\clang\" />
5+
<File Include="$(_LLVMInstallDir)\bin\libclang.dll" TargetPath="tools\$(PackageTargetRuntime)\bin\" Condition="'$(TargetArchitecture)' != 'arm' and '$(TargetArchitecture)' != 'arm64'" />
46
<File Include="$(_LLVMInstallDir)\bin\llvm-config.exe" TargetPath="tools\$(PackageTargetRuntime)\bin\" />
57
<File Include="$(_LLVMInstallDir)\bin\llvm-dis.exe" TargetPath="tools\$(PackageTargetRuntime)\bin\" />
68
<File Include="$(_LLVMInstallDir)\bin\llvm-tblgen.exe" TargetPath="tools\$(PackageTargetRuntime)\bin\" />

0 commit comments

Comments
 (0)