pantry/projects/llvm.org/package.yml

93 lines
2.6 KiB
YAML
Raw Normal View History

2022-08-02 20:34:21 +03:00
distributable:
url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version }}/llvm-project-{{ version }}.src.tar.xz
strip-components: 1
2022-09-03 00:03:23 +03:00
#TODO depends on the command line tools
2022-08-02 20:34:21 +03:00
versions:
github: llvm/llvm-project
strip: /^LLVM /
ignore: 15.y.z
# ^^ wont even build pkg-config lol
# tested: [15.0.0]
2022-08-02 20:34:21 +03:00
provides:
- bin/lld
- bin/clang
- bin/clang++
build:
dependencies:
tea.xyz/gx/cc: c99
cmake.org: 3
ninja-build.org: 1
python.org: 3
working-directory: build
script: |-
cmake \
../llvm \
-G Ninja \
$ARGS
ninja
ninja install
#TMP these are required for many build-scripts to function
# however we want to provide a “generic” system for this
# but it's too early
cd {{ prefix }}/bin
ln -sf clang cc
ln -sf clang++ c++
ln -sf lld ld
2022-08-17 15:22:22 +03:00
for x in ar as strip objcopy nm objdump ranlib readelf strings; do
2022-08-02 20:34:21 +03:00
ln -sf llvm-$x $x
done
# need this or if `gcc` is in the PATH then configure often will use `gcc`
# coupled with one of the above as a sub-task (eg. `as`) and gcc feeds it
# the wrong args
#FIXME longer term we should not have any hacks outside of `build.ts`
ln -sf clang gcc
ln -sf clang++ g++
2022-08-27 18:58:16 +03:00
#TODO the above hacks should be a separate directory that can be added
# to the PATH when tea.xyz/gx/cc is used
#NOTE they must be symlinks as clang/llvm behave differently based on their arg0 name
2022-08-02 20:34:21 +03:00
receipt:
- LLVMConfig.cmake
env:
ARGS:
- -DCMAKE_INSTALL_PREFIX="{{ prefix }}"
- -DCMAKE_BUILD_TYPE=Release
- -DLLVM_ENABLE_PROJECTS='lld;clang'
2022-08-24 00:28:58 +03:00
- -DLLVM_INCLUDE_DOCS=OFF
- -DLLVM_INCLUDE_TESTS=OFF
2022-08-27 18:58:16 +03:00
# the default is `ld` however clang when handling linking itself
# internally passes flags that, in fact, expect `lld`
#NOTE yes this is an issue even if `ld` is in fact a symlink to `lld`
2022-08-24 00:28:58 +03:00
- -DCLANG_DEFAULT_LINKER=lld
2022-08-31 21:05:21 +03:00
darwin:
ARGS:
#FIXME shouldnt *have to* require the command line tools package
2022-09-02 04:02:45 +03:00
#FIXME this is no good for systems with only Xcode installed
#NOTE how do Apple make their LLVM find both? we want the same trick
2022-08-31 21:05:21 +03:00
- -DDEFAULT_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
2022-08-27 18:58:16 +03:00
linux/x86-64:
ARGS:
# required to build something that works on linux/x86-64
- -DCLANG_DEFAULT_CXX_STDLIB=libstdc++
- -DCLANG_DEFAULT_RTLIB=libgcc
- -DCOMPILER_RT_INCLUDE_TESTS=OFF
- -DCOMPILER_RT_USE_LIBCXX=OFF"
2022-08-02 20:34:21 +03:00
test:
2022-08-24 00:28:58 +03:00
fixture: |
#include <stdio.h>
int main() {
printf("Hello World!\n");
return 0;
}
script: |
mv $FIXTURE $FIXTURE.c
clang $FIXTURE.c
./a.out