diff --git a/scripts/build.sh b/scripts/build.sh index 9cc5812b..dc702f4f 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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)" @@ -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.' diff --git a/scripts/setup.sh b/scripts/setup.sh index 24e091c2..63bc76ee 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -152,12 +152,13 @@ else unzip \ coreutils \ lsb-release \ + bc \ rsync \ wget \ libunwind-dev \ zlib1g-dev \ vulkan-tools \ - libvulkan1 \ + libvulkan1 # vulkan vulkan-utils fi