Skip to content

Commit

Permalink
fix clang for cmake on ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
admercs committed Apr 24, 2024
1 parent fc8d881 commit 9ca15aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ if [ "$(uname)" = 'Darwin' ]; then
else
SYSTEM_INFO="$(system_info)"
SYSTEM_PLATFORM="$(system_arch)"
source /etc/os-release
fi
SYSTEM_CPU_MAX="$(( $(nproc) - 2 ))"
SYSTEM_OS_VERSION="$(system_os)"
Expand Down Expand Up @@ -124,16 +125,19 @@ if [ "$(uname)" = 'Darwin' ]; then
export CXX="$(brew --prefix)/opt/llvm@${CLANG_VERSION}/bin/clang++"
CMAKE_VARS="-DCXX_STANDARD=c++${CXX_STANDARD} -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_APPLE_SILICON_PROCESSOR=${SYSTEM_PLATFORM}"
elif [ "$(uname)" = 'Linux' ]; then
if [ "${USE_GCC}" = 'true' ]; then
if [ "$USE_GCC" = 'true' ]; then
export CC="gcc-${GCC_VERSION}"
export CXX="g++-${GCC_VERSION}"
CMAKE_VARS="-DCXX_STANDARD=c++${CXX_STANDARD}"
else
if (( $(echo "${VERSION_ID} < 22.04" | bc -l) )); then
CMAKE_VARS="-DCXX_STANDARD=c++${CXX_STANDARD} -DCMAKE_CXX_FLAGS=-stdlib=libc++"
else
CMAKE_VARS="-DCXX_STANDARD=c++${CXX_STANDARD}"
fi
export CC="clang-${CLANG_VERSION}"
export CXX="clang++-${CLANG_VERSION}"
CMAKE_VARS="-DCXX_STANDARD=c++${CXX_STANDARD}
-DCMAKE_CXX_FLAGS=-stdlib=libc++
-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=/usr/include/c++/12:/usr/include/x86_64-linux-gnu/c++/12"

fi
else
echo 'ERROR: This build script only supports Linux and MacOS.'
Expand Down
3 changes: 2 additions & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,13 @@ else
unzip \
coreutils \
lsb-release \
bc \
rsync \
wget \
libunwind-dev \
zlib1g-dev \
vulkan-tools \
libvulkan1 \
libvulkan1
# vulkan vulkan-utils
fi

Expand Down

0 comments on commit 9ca15aa

Please sign in to comment.