File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,16 @@ prepare_flags() {
119119 CMAKE_ARGS+=(' -DBUILD_TESTS=OFF' )
120120 fi
121121 if [[ " $COMPILER " = ' clang' ]]; then
122- CMAKE_ARGS+=(' -DCMAKE_C_COMPILER=clang' ' -DCMAKE_CXX_COMPILER=clang++' )
122+ local llvm_version=18 # should match the value in depends/setup.sh
123+ if command -v " clang-$llvm_version " & > /dev/null &&
124+ command -v " clang++-$llvm_version " & > /dev/null; then
125+ CMAKE_ARGS+=(
126+ " -DCMAKE_C_COMPILER=clang-$llvm_version "
127+ " -DCMAKE_CXX_COMPILER=clang++-$llvm_version "
128+ )
129+ else
130+ CMAKE_ARGS+=(' -DCMAKE_C_COMPILER=clang' ' -DCMAKE_CXX_COMPILER=clang++' )
131+ fi
123132 elif [[ " $COMPILER " = ' gcc' ]]; then
124133 CMAKE_ARGS+=(' -DCMAKE_C_COMPILER=gcc' ' -DCMAKE_CXX_COMPILER=g++' )
125134 fi
You can’t perform that action at this time.
0 commit comments