build: link against libLLVM.so if available
readme: better instructions for finding native libc headers
This commit is contained in:
parent
d908afe105
commit
037283c3b3
|
@ -75,14 +75,14 @@ compromises backward compatibility.
|
|||
|
||||
### Debug / Development Build
|
||||
|
||||
If you have gcc or clang installed, you can find out what `ZIG_LIBC_LIB_DIR`
|
||||
and `ZIG_LIBC_STATIC_LIB_DIR` should be set to (example below).
|
||||
`ZIG_LIBC_INCLUDE_DIR` likely can be set to `/usr/include`.
|
||||
If you have gcc or clang installed, you can find out what `ZIG_LIBC_LIB_DIR`,
|
||||
`ZIG_LIBC_STATIC_LIB_DIR`, and `ZIG_LIBC_INCLUDE_DIR` should be set to
|
||||
(example below).
|
||||
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd) -DZIG_LIBC_LIB_DIR=$(dirname $(cc -print-file-name=crt1.o)) -DZIG_LIBC_INCLUDE_DIR=/usr/include -DZIG_LIBC_STATIC_LIB_DIR=$(dirname $(cc -print-file-name=crtbegin.o))
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd) -DZIG_LIBC_LIB_DIR=$(dirname $(cc -print-file-name=crt1.o)) -DZIG_LIBC_INCLUDE_DIR=$(echo -n | cc -E -x c - -v 2>&1 | grep -B1 "End of search list." | head -n1 | cut -c 2-) -DZIG_LIBC_STATIC_LIB_DIR=$(dirname $(cc -print-file-name=crtbegin.o))
|
||||
make
|
||||
make install
|
||||
./run_tests
|
||||
|
|
|
@ -29,6 +29,12 @@ execute_process(
|
|||
OUTPUT_VARIABLE LLVM_INCLUDE_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
find_library(LLVM_LIBRARY NAMES LLVM)
|
||||
|
||||
if(LLVM_LIBRARY)
|
||||
set(LLVM_LIBRARIES ${LLVM_LIBRARY})
|
||||
endif()
|
||||
|
||||
|
||||
set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user