Skip to content

Commit

Permalink
Build with zlib on Unix (#456)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
  • Loading branch information
2 people authored and radekdoulik committed Aug 16, 2024
1 parent ae2e199 commit b6a9485
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion eng/azure-pipelines-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ stages:
assetManifestPlatform: x64
imagename: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64
rootfs: /crossrootfs/x64
ExtraArgs: -p:LibsRoot=/crossrootfs/x64/usr/lib/x86_64-linux-gnu
ClangTargetArg: /p:ClangTarget=x86_64-linux-gnu
ClangBinDirArg: /p:ClangBinDir=/usr/local/bin
archflag: --arch x64
Expand All @@ -65,7 +66,7 @@ stages:
displayName: Initialize CodeQL (manually-injected)

- bash: |
./build.sh --ci --restore --build --pack $(archflag) --configuration $(_BuildConfig) $(_InternalBuildArgs) $(ClangBinDirArg) $(ClangTargetArg)
./build.sh --ci --restore --build --pack $(archflag) --configuration $(_BuildConfig) $(_InternalBuildArgs) $(ClangBinDirArg) $(ClangTargetArg) $(ExtraArgs)
displayName: 'Build and package'
env:
ROOTFS_DIR: $(rootfs)
Expand Down
9 changes: 7 additions & 2 deletions eng/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ stages:
assetManifestPlatform: x64
imagename: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64
rootfs: /crossrootfs/x64
ExtraArgs: -p:LibsRoot=/crossrootfs/x64/usr/lib/x86_64-linux-gnu
ClangTargetArg: /p:ClangTarget=x86_64-linux-gnu
ClangBinDirArg: /p:ClangBinDir=/usr/local/bin
archflag: --arch x64
Expand All @@ -50,6 +51,7 @@ stages:
assetManifestPlatform: arm64
imagename: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64
rootfs: /crossrootfs/arm64
ExtraArgs: -p:LibsRoot=/crossrootfs/arm64/usr/lib/aarch64-linux-gnu
ClangTargetArg: /p:ClangTarget=aarch64-linux-gnu
ClangBinDirArg: /p:ClangBinDir=/usr/local/bin
archflag: --arch arm64
Expand All @@ -58,6 +60,7 @@ stages:
assetManifestPlatform: arm
imagename: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm
rootfs: /crossrootfs/arm
ExtraArgs: -p:LibsRoot=/crossrootfs/arm/usr/lib/arm-linux-gnueabihf
ClangTargetArg: /p:ClangTarget=arm-linux-gnueabihf
ClangBinDirArg: /p:ClangBinDir=/usr/local/bin
archflag: --arch arm
Expand All @@ -78,7 +81,7 @@ stages:
displayName: 'Clean up working directory'
- bash: |
./build.sh --ci --restore --build --pack $(archflag) --configuration $(_BuildConfig) $(_InternalBuildArgs) $(ClangBinDirArg) $(ClangTargetArg)
./build.sh --ci --restore --build --pack $(archflag) --configuration $(_BuildConfig) $(_InternalBuildArgs) $(ClangBinDirArg) $(ClangTargetArg) $(ExtraArgs)
displayName: 'Build and package'
env:
ROOTFS_DIR: $(rootfs)
Expand All @@ -101,6 +104,7 @@ stages:
assetManifestPlatform: x64
imagename: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine
rootfs: /crossrootfs/x64
ExtraArgs: -p:LibsRoot=/crossrootfs/x64/lib
ClangTargetArg: /p:ClangTarget=x86_64-alpine-linux-musl
ClangBinDirArg: /p:ClangBinDir=/usr/local/bin
archflag: --arch x64
Expand All @@ -109,6 +113,7 @@ stages:
assetManifestPlatform: arm64
imagename: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine
rootfs: /crossrootfs/arm64
ExtraArgs: -p:LibsRoot=/crossrootfs/arm64/lib
ClangTargetArg: /p:ClangTarget=aarch64-alpine-linux-musl
ClangBinDirArg: /p:ClangBinDir=/usr/local/bin
archflag: --arch arm64
Expand All @@ -129,7 +134,7 @@ stages:
displayName: 'Clean up working directory'
- bash: |
./build.sh --ci --restore --build --pack $(archflag) --configuration $(_BuildConfig) $(_InternalBuildArgs) /p:OutputRid=linux-musl-$(assetManifestPlatform) $(ClangBinDirArg) $(ClangTargetArg)
./build.sh --ci --restore --build --pack $(archflag) --configuration $(_BuildConfig) $(_InternalBuildArgs) /p:OutputRid=linux-musl-$(assetManifestPlatform) $(ClangBinDirArg) $(ClangTargetArg) $(ExtraArgs)
displayName: 'Build and package'
env:
ROOTFS_DIR: $(rootfs)
Expand Down
4 changes: 3 additions & 1 deletion llvm.proj
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@
<_LLVMBuildArgs Condition="'$(BuildOS)' == 'Windows_NT' and '$(Configuration)' == 'Release'" Include='-DLLVM_USE_CRT_RELEASE=MT' />
<_LLVMBuildArgs Condition="'$(BuildOS)' == 'Windows_NT' and '$(Configuration)' == 'Debug'" Include='-DLLVM_USE_CRT_DEBUG=MTd' />
<_LLVMBuildArgs Condition="'$(BuildOS)' == 'Windows_NT' and '$(Configuration)' == 'Debug'" Include='-DLLVM_USE_CRT_RELEASE=MTd' />
<_LLVMBuildArgs Condition="'$(BuildOS)' == 'Windows_NT'" Include='-DLLVM_ENABLE_ZLIB=OFF' />
<_LLVMBuildArgs Condition="'$(BuildOS)' == 'Windows_NT'" Include='-DLLVM_NATIVE_TOOL_DIR=$(NativeTablegenDir)' />
<_LLVMBuildArgs Condition="'$(BuildOS)' != 'Windows_NT'" Include='-DLLVM_ENABLE_ZLIB=FORCE_ON' />
<_LLVMBuildArgs Condition="'$(BuildOS)' != 'Windows_NT' and '$(LibsRoot)' != ''" Include='-DZLIB_ROOT=$(LibsRoot)' />
<_LLVMBuildArgs Condition="'$(BuildOS)' == 'Windows_NT'" Include='-DLLVM_ENABLE_ZLIB=OFF' />
<_LLVMBuildArgs Include='-DLLVM_ENABLE_PROJECTS="lld%3Bclang%3Bclang-tools-extra"' />
<_LLVMBuildArgs Include='-DLLVM_BUILD_TOOLS:BOOL=ON' />
<_LLVMBuildArgs Include='-DLLVM_INSTALL_UTILS:BOOL=ON' />
Expand Down

0 comments on commit b6a9485

Please sign in to comment.