2020-04-07 02:53:23 +00:00
|
|
|
#!/bin/sh -ex
|
|
|
|
|
2018-07-16 01:12:43 +00:00
|
|
|
export CCACHE_SLOPPINESS=pch_defines,time_macros
|
|
|
|
export CMAKE_PREFIX_PATH=/usr/local/opt/qt5/
|
|
|
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
|
|
|
|
# Setup vulkan and gfx-rs/portability
|
|
|
|
curl -sLO https://github.com/gfx-rs/portability/releases/download/latest/gfx-portability-macos-latest.zip
|
|
|
|
unzip -: gfx-portability-macos-latest.zip
|
2019-06-02 07:44:05 +00:00
|
|
|
curl -sLO https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.106.0.zip
|
2018-07-16 01:12:43 +00:00
|
|
|
unzip -: sdk-*.zip
|
|
|
|
mkdir vulkan-sdk
|
2020-04-07 02:53:23 +00:00
|
|
|
ln -s "${PWD}"/Vulkan-Headers*/include vulkan-sdk/include
|
2018-07-16 01:12:43 +00:00
|
|
|
mkdir vulkan-sdk/lib
|
2018-11-24 00:27:33 +00:00
|
|
|
cp target/release/libportability.dylib vulkan-sdk/lib/libVulkan.dylib
|
|
|
|
# Let macdeployqt locate and install Vulkan library
|
2020-04-07 02:53:23 +00:00
|
|
|
install_name_tool -id "${PWD}"/vulkan-sdk/lib/libVulkan.dylib vulkan-sdk/lib/libVulkan.dylib
|
|
|
|
export VULKAN_SDK="${PWD}/vulkan-sdk"
|
2018-07-16 01:12:43 +00:00
|
|
|
|
2020-04-07 02:53:23 +00:00
|
|
|
# Pull all the submodules except llvm
|
|
|
|
# Note: Tried to use git submodule status, but it takes over 20 seconds
|
|
|
|
# shellcheck disable=SC2046
|
|
|
|
git submodule -q update --init $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
|
2018-07-16 01:12:43 +00:00
|
|
|
|
2020-04-07 02:53:23 +00:00
|
|
|
mkdir build && cd build || exit 1
|
2018-12-20 05:55:05 +00:00
|
|
|
cmake .. -DWITH_LLVM=OFF -DUSE_NATIVE_INSTRUCTIONS=OFF -G Ninja
|
2018-07-16 01:12:43 +00:00
|
|
|
ninja
|