Skip to content

Commit

Permalink
add BUILD_WITH_CLANG flag
Browse files Browse the repository at this point in the history
when set BUILD_WITH_CLANG=true, source build.sh will build with clang.

Ex.

```
export LLVM_DIR=/usr/src/clang-r487747
export LLVM_CONFIG=$LLVM_DIR/bin/llvm-config

BUILD_WITH_CLANG=true source build.sh
```
  • Loading branch information
joeyjiaojg committed May 16, 2023
1 parent cc556ab commit 4b43bed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs=$(echo $(nproc) || echo $(sysctl -n hw.physicalcpu))
#########
# VARs and Links
########
CMAKE_EXTRA_FLAGS=""
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SVFHOME="${SCRIPT_DIR}"
sysOS=$(uname -s)
Expand Down Expand Up @@ -222,10 +223,11 @@ BUILD_DIR="./${BUILD_TYPE}-build"

rm -rf "${BUILD_DIR}"
mkdir "${BUILD_DIR}"
[ "${BUILD_WITH_CLANG}" != "" ] && CMAKE_EXTRA_FLAGS="-DCMAKE_CXX_COMPILER=$LLVM_DIR/bin/clang++ -DLLVM_DIR=$LLVM_DIR"
cmake -D CMAKE_BUILD_TYPE:STRING="${BUILD_TYPE}" \
-DSVF_ENABLE_ASSERTIONS:BOOL=true \
-DSVF_SANITIZE="${SVF_SANITIZER}" \
-S "${SVFHOME}" -B "${BUILD_DIR}"
-S "${SVFHOME}" -B "${BUILD_DIR}" ${CMAKE_EXTRA_FLAGS}
cmake --build "${BUILD_DIR}" -j ${jobs}

########
Expand Down

0 comments on commit 4b43bed

Please sign in to comment.