Skip to content

Commit 3ca595b

Browse files
committed
build: slim llvm build
1 parent 240921d commit 3ca595b

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,27 @@ jobs:
375375
# FIXME: Build this for the GCC and MacOS sanitizer jobs.
376376
# Currently GCC fails linking it, and for MacOS there are compiler-rt
377377
# requirements not satisfied.
378+
- name: Fetch LLVM source archive
379+
if: steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
380+
run: |
381+
set -eux
382+
mkdir -p ../third-party
383+
cd ../third-party
384+
archive="llvm-${{ matrix.llvm-hash }}.zip"
385+
if [ ! -d llvm-project ]; then
386+
curl -L -o "$archive" "https://github.com/llvm/llvm-project/archive/${{ matrix.llvm-hash }}.zip"
387+
unzip -q "$archive"
388+
mv "llvm-project-${{ matrix.llvm-hash }}" llvm-project
389+
rm "$archive"
390+
fi
391+
378392
- name: Install libc++
379393
id: install_libcxx
380394
uses: alandefreitas/cpp-actions/[email protected]
381395
if: matrix.use-libcxx == 'true' && steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
382396
with:
383397
cmake-version: '>=3.26'
384398
source-dir: ../third-party/llvm-project/runtimes
385-
git-repository: https://github.com/llvm/llvm-project.git
386-
git-tag: ${{ matrix.llvm-hash }}
387-
download-dir: ../third-party/llvm-project
388399
build-dir: ${sourceDir}/build
389400
build-type: ${{ matrix.build-type }}
390401
extra-args: |
@@ -419,9 +430,6 @@ jobs:
419430
with:
420431
cmake-version: '>=3.26'
421432
source-dir: ../third-party/llvm-project/llvm
422-
git-repository: https://github.com/llvm/llvm-project.git
423-
git-tag: ${{ matrix.llvm-hash }}
424-
download-dir: ../third-party/llvm-project
425433
patches: |
426434
./third-party/patches/llvm/llvm/CMakePresets.json
427435
./third-party/patches/llvm/llvm/CMakeUserPresets.json

third-party/patches/llvm/llvm/CMakePresets.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
"LLVM_ENABLE_RUNTIMES": "libcxx",
1919
"LLVM_TARGETS_TO_BUILD": "Native",
2020

21+
"LLVM_DISTRIBUTION_COMPONENTS": "clang;clang-cpp;clang-resource-headers;llvm-headers;llvm-config",
22+
23+
"LLVM_ENABLE_ZLIB": false,
24+
"LLVM_ENABLE_ZSTD": false,
25+
"LLVM_ENABLE_LIBXML2": false,
26+
"LLVM_ENABLE_BACKTRACES": false,
27+
2128
"LLVM_UNREACHABLE_OPTIMIZE": false,
2229
"LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION": false,
2330
"LLVM_ENABLE_RTTI": true,
@@ -43,14 +50,20 @@
4350
"LLVM_BUILD_DOCS": false,
4451
"LLVM_BUILD_EXAMPLES": false,
4552
"LLVM_ENABLE_TERMINFO": false,
46-
"CLANG_ENABLE_ARCMT": true,
53+
"CLANG_ENABLE_ARCMT": false,
4754
"CLANG_ENABLE_HLSL": false,
4855
"CLANG_ENABLE_OBJC_REWRITER": false,
4956
"CLANG_ENABLE_PROTO_FUZZER": false,
50-
"CLANG_ENABLE_STATIC_ANALYZER": true,
57+
"CLANG_ENABLE_STATIC_ANALYZER": false,
58+
"CLANG_ENABLE_FORMAT": false,
5159
"CLANG_INCLUDE_TESTS": false,
5260
"CLANG_INCLUDE_DOCS": false,
53-
"CLANG_BUILD_EXAMPLES": false
61+
"CLANG_BUILD_EXAMPLES": false,
62+
63+
"LIBCXX_ENABLE_SHARED": false,
64+
"LIBCXX_ENABLE_STATIC": true,
65+
"LIBCXX_INCLUDE_TESTS": false,
66+
"LIBCXX_INCLUDE_BENCHMARKS": false
5467
},
5568
"warnings": {
5669
"unusedCli": false

0 commit comments

Comments
 (0)