forked from shader-slang/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github_build.sh
38 lines (28 loc) · 1.26 KB
/
github_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
# Get premake
if [[ "aarch64" == "${ARCH}" ]]; then
wget https://github.com/shader-slang/slang-binaries/blob/master/premake/premake-5.0.0-alpha16/bin/linux-arm64/premake5?raw=true -O premake5
else
wget https://github.com/shader-slang/slang-binaries/blob/master/premake/premake-5.0.0-alpha16/bin/linux-64/premake5?raw=true -O premake5
fi
chmod u+x premake5
# generate slang-tag-version.h
git describe --tags | sed -e "s/\(.*\)/\#define SLANG_TAG_VERSION \"\1\"/" > slang-tag-version.h
cat slang-tag-version.h
if [[ "" == "${TARGETARCH}" ]]; then
TARGETARCH=${ARCH}
fi
if [[ "${ARCH}" != "${TARGETARCH}" ]]; then
# Create the makefile
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${ARCH} --deps=true --no-progress=true
# Build the configuration
make config=${CONFIGURATION}_${ARCH} -j`nproc`
rm -rf ./bin
# Create the makefile
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${TARGETARCH} --deps=true --no-progress=true --skip-source-generation=true --deploy-slang-llvm=false --deploy-slang-glslang=false
else
# Create the makefile
./premake5 gmake2 --cc=${CC} --enable-embed-stdlib=true --arch=${TARGETARCH} --deps=true --no-progress=true
fi
# Build the configuration
make config=${CONFIGURATION}_${TARGETARCH} -j`nproc`