-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify linux build scripts to try to pick up correct arch (#82)
Based on system status, pick up correct arch. For vcpkg mapping that I figured out is as following: * x86_64 -> x64 * aarch64 -> arm64 So a simple case could take of that and save a bit of time for people who are first time compiling RayTracingInVulkan.
- Loading branch information
Showing
2 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
arch=$(uname -m) | ||
vcpkg_arch="" | ||
case ${arch} in | ||
"aarch64") | ||
vcpkg_arch="arm64" | ||
if [ -z ${VCPKG_FORCE_SYSTEM_BINARIES} ]; then | ||
echo "VCPKG_FORCE_SYSTEM_BINARIES must be set to 1 on aarch64!" | ||
exit 1 | ||
fi | ||
;; | ||
"x86_64") | ||
vcpkg_arch="x64" | ||
;; | ||
*) | ||
echo "Please check the mapping for 'uname -m' output to vcpkg expected arch" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
nproc=$(nproc || echo 4) | ||
|
||
mkdir --parents build/linux | ||
cd build/linux | ||
cmake -D CMAKE_BUILD_TYPE=Release -D VCPKG_TARGET_TRIPLET=x64-linux -D CMAKE_TOOLCHAIN_FILE=../vcpkg.linux/scripts/buildsystems/vcpkg.cmake ../.. | ||
make -j | ||
cmake -D Boost_NO_SYSTEM_PATHS=ON -D CMAKE_BUILD_TYPE=Release -D VCPKG_TARGET_TRIPLET="${vcpkg_arch}-linux" -D CMAKE_TOOLCHAIN_FILE=../vcpkg.linux/scripts/buildsystems/vcpkg.cmake ../.. | ||
make -j${nproc} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters