diff options
author | Radek Doulik <radek.doulik@gmail.com> | 2021-12-17 23:43:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 23:43:47 +0300 |
commit | b534b55047f45d1724d0830539d90578b1620662 (patch) | |
tree | 36aa195af8054db179f8687603b749459ad5ba03 | |
parent | 662aff66999c435aec09c58643e9fd703eadc3e0 (diff) |
Build libclang, add it to nuget, add python bindings (#149)
Context: https://github.com/dotnet/runtime/issues/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
5 files changed, 13 insertions, 1 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 60ada7276fdf..37df976ff249 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -126,7 +126,7 @@ stages: ############ WINDOWS BUILD ############ - job: Build_Windows displayName: Windows - timeoutInMinutes: 120 + timeoutInMinutes: 140 strategy: matrix: x64: diff --git a/llvm.proj b/llvm.proj index 73ea16476550..5668e11f9893 100644 --- a/llvm.proj +++ b/llvm.proj @@ -70,6 +70,14 @@ <_LLVMBuildArgs Condition="'$(BuildOS)' == 'Windows_NT'" Include='-DLLVM_USE_CRT_RELEASE=MT' /> </ItemGroup> + <ItemGroup Condition="'$(TargetArchitecture)' != 'arm' and '$(TargetArchitecture)' != 'arm64'"> + <_LLVMBuildArgs Include='-DLLVM_ENABLE_PROJECTS=clang' /> + <_LLVMBuildArgs Include='-DCLANG_BUILD_TOOLS:BOOL=OFF' /> + <_LLVMBuildArgs Include='-DCLANG_INCLUDE_TESTS:BOOL=OFF' /> + <_LLVMBuildArgs Include='-DCLANG_ENABLE_ARCMT:BOOL=OFF' /> + <_LLVMBuildArgs Include='-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=OFF' /> + </ItemGroup> + <PropertyGroup Condition="'$(BuildOS)' != 'Windows_NT'"> <_CrossCFlags Condition="'$(BuildOS)' == 'Linux' and '$(TargetArchitecture)' == 'arm64'">--target=aarch64-linux-gnu --sysroot=$(ROOTFS_DIR)</_CrossCFlags> <_CrossCFlags Condition="'$(BuildOS)' == 'Linux' and '$(TargetArchitecture)' == 'arm'">--target=arm-linux-gnueabihf --sysroot=$(ROOTFS_DIR)</_CrossCFlags> diff --git a/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Linux.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props b/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Linux.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props index be5009cc14eb..a38988124ca1 100644 --- a/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Linux.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props +++ b/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Linux.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <Project> <ItemGroup> + <File Include="$(ProjectDir)\clang\bindings\python\clang\**" TargetPath="bindings\python\clang\" /> <File Include="$(_LLVMInstallDir)\bin\llvm-config" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> <File Include="$(_LLVMInstallDir)\bin\llvm-config.dbg" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> <File Include="$(_LLVMInstallDir)\bin\llvm-dis" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> diff --git a/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.OSX.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props b/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.OSX.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props index 298e8a1ffd92..21bab096c5e9 100644 --- a/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.OSX.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props +++ b/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.OSX.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <Project> <ItemGroup> + <File Include="$(ProjectDir)\clang\bindings\python\clang\**" TargetPath="bindings\python\clang\" /> <File Include="$(_LLVMInstallDir)\bin\llvm-config" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> <File Include="$(_LLVMInstallDir)\bin\llvm-config.dwarf" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> <File Include="$(_LLVMInstallDir)\bin\llvm-dis" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> diff --git a/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Windows_NT.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props b/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Windows_NT.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props index 467d1327746a..5e54411ce963 100644 --- a/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Windows_NT.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props +++ b/nuget/Microsoft.NETCore.Runtime.Mono.LLVM.Sdk/runtime.Windows_NT.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk.props @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <Project> <ItemGroup> + <File Include="$(ProjectDir)\clang\bindings\python\clang\**" TargetPath="bindings\python\clang\" /> + <File Include="$(_LLVMInstallDir)\bin\libclang.dll" TargetPath="tools\$(PackageTargetRuntime)\bin\" Condition="'$(TargetArchitecture)' != 'arm' and '$(TargetArchitecture)' != 'arm64'" /> <File Include="$(_LLVMInstallDir)\bin\llvm-config.exe" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> <File Include="$(_LLVMInstallDir)\bin\llvm-config.pdb" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> <File Include="$(_LLVMInstallDir)\bin\llvm-dis.exe" TargetPath="tools\$(PackageTargetRuntime)\bin\" /> |