llvm: new labs.h, better cmake parameters
This commit is contained in:
parent
af88835b80
commit
47e9a14919
7
llvm/labs.h
Normal file
7
llvm/labs.h
Normal file
@ -0,0 +1,7 @@
|
||||
#include <cstdlib>
|
||||
|
||||
namespace std {
|
||||
static inline long abs(long a) { return std::labs(a); }
|
||||
static inline long long abs(long long a) { return std::labs(a); }
|
||||
}
|
||||
|
@ -1,14 +1,19 @@
|
||||
name: llvm
|
||||
version: 8.0.1
|
||||
release: 2
|
||||
sources: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz
|
||||
sources:
|
||||
- https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz
|
||||
- labs.h
|
||||
|
||||
dependencies:
|
||||
- libffi
|
||||
- libcxx
|
||||
|
||||
build-dependencies: python
|
||||
build-dependencies: python, libcxx-dev
|
||||
|
||||
@configure
|
||||
mkdir %{name}-%{version}
|
||||
|
||||
cd %{name}-%{version} && \
|
||||
cmake ../llvm-%{version}.src \
|
||||
-DCMAKE_INSTALL_PREFIX="%{prefix}" \
|
||||
@ -19,7 +24,6 @@ build-dependencies: python
|
||||
-DLLVM_ENABLE_ASSERTIONS=OFF \
|
||||
-DLLVM_ENABLE_CXX1Y=ON \
|
||||
-DLLVM_ENABLE_FFI=ON \
|
||||
-DLLVM_ENABLE_LIBCXX=OFF \
|
||||
-DLLVM_ENABLE_PIC=ON \
|
||||
-DLLVM_ENABLE_RTTI=ON \
|
||||
-DLLVM_ENABLE_SPHINX=OFF \
|
||||
@ -28,8 +32,11 @@ build-dependencies: python
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
||||
-DLLVM_LINK_LLVM_DYLIB=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_FLAGS="-fPIC -O2" \
|
||||
-DCMAKE_C_FLAGS="-fPIC -O2"
|
||||
-DLLVM_ENABLE_LIBCXX=ON \
|
||||
-DCMAKE_CXX_COMPILER="clang++" \
|
||||
-DCMAKE_CXX_FLAGS="$CXXFLAGS -stdlib=libc++ -include /usr/weirdos/include/c++/v1/math.h -include $(pwd)/../labs.h -D__DEFINED_max_align_t" \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS" \
|
||||
-DCMAKE_LD_FLAGS="$LDFLAGS -lc++"
|
||||
|
||||
# when llvm-8 won't be the lastest LLVM version anymore
|
||||
# -DCMAKE_INSTALL_PREFIX=/usr/bad/%{name}
|
||||
|
Reference in New Issue
Block a user