Browse Source

Fixed vulkan build

master
dirkson 3 years ago
parent
commit
67930206ad
  1. 4
      .gitignore
  2. 127
      subprojects/dependencies
  3. 4
      subprojects/graphene.wrap

4
.gitignore

@ -95,5 +95,7 @@ bin/*
# Build framework
meson/*
subprojects/*
meson-log.txt
subprojects/*/*
subprojects/*.gz

127
subprojects/dependencies

@ -0,0 +1,127 @@
#!/bin/bash
# This file gets included wholesale into the osmia script.
# Anything you could do in that file, you can do in this.
# The "#!/bin/sh" isn't required, but helps with syntax highlighting.
# This file is executed in projectdir/dependencydir
#if [ ! -x "$(command /sbin/ldconfig -p)" ]; then
# if [ -z "$(/sbin/ldconfig -p | grep -i graphene)" ]; then
# osmia_get graphene "git clone https://github.com/ebassi/graphene"
# fi
#else
# osmia_get graphene "git clone https://github.com/ebassi/graphene"
#fi
#cd graphene/
#COMPILER=gcc MESONOPTS=--default-library=static ../../build -r
#if [ ! $? -eq 0 ]; then
# echo "Failed to build graphene"
# exit 1
#fi
#Did we really just call our own build script on somebody else's meson build?
#Yes we did Other Dirkson. Yes we did.
#cp lib/*.a ../
#cd ../
#shaderc directly
#if [ ! -d shaderc ]; then
# ../scripts/buildshaderc
# if [ ! $? -eq 0 ]; then
# echo "Shaderc/glslc script failure"
# exit 1
# fi
#fi
#The meson SDK provides shaderc, so we'll just grab and build that.
#if [ ! -d "vulkan" ]; then
if [ ! -d "vulkan" ]; then
if [ ! -f "vulkan-sdk.tar.gz" ]; then
echo "Oops. Lunarg made it so we can't download their SDK automatically, so please grab the SDK from the following link and drop it into the \"subprojects\" directory."
echo "https://vulkan.lunarg.com/sdk/home"
echo "It should be named \"vulkan-sdk.tar.gz\""
exit 1
fi
#We'll need a url downloader and tar
# if [ -z "$DOWNLOADER" ]; then
# if [ -x "$(command -v wget)" ]; then
# DOWNLOADER="wget -O "
# elif [ -x "$(command -v curl)" ]; then
# DOWNLOADER="curl -o "
# else
# echo "Unable to find any compiler at all. Please install one: clang, musl-gcc, gcc, tcc, icc"
# exit 1
# fi
# fi
if [ ! -x "$(command -v tar)" ]; then
echo "Unable to find tar. Please install."
exit 1
fi
# Now we actually do the work
mkdir -p vulkan 2> /dev/null
cd vulkan
# $DOWNLOADER 'vulkan-sdk.tar.gz' 'https://vulkan.lunarg.com/sdk/home'
# $DOWNLOADER 'vulkan-sdk.tar.gz' 'https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.tar.gz?u='
# if [ ! $? -eq 0 ]; then
# echo "Failed to download vulkan sdk"
# cd ../
# rm -rf vulkan
# exit 1
# fi
tar -xf ../vulkan-sdk.tar.gz
if [ ! $? -eq 0 ]; then
echo "Failed to unpack vulkan sdk"
cd ../
rm -rf vulkan
exit 1
fi
mv ./1.*/* .
rm -rf ./1.*
./build_tools.sh
if [ ! $? -eq 0 ]; then
echo "vulkan build script failure"
exit 1
fi
cd ../../
#adjust includes
ln -s ../subprojects/vulkan/x86_64/include/vulkan/ ../include/
ln -s ../subprojects/vulkan/x86_64/include/libshaderc ../include/
fi
#No matter what, we'll need the new env
#Except we can't. So tell the user to do it. UGH.
chmod ug+x ./vulkan/setup-env.sh
#./vulkan/1.*/setup-env.sh
#source ./vulkan/1.*/setup-env.sh
#LOCATION="source ./vulkan/1.*/setup-env.sh"
#eval $("source ./vulkan/1.*/setup-env.sh")
#eval $("echo \"bob\"")
echo "You may wish to copy paste this line: source" ./subprojects/vulkan/setup-env.sh
#echo "source $LOCATION"
#eval $("source $LOCATION")
#eval $("pwd")
#Currently it doesn't provide error info
#if [ ! $? -eq 0 ]; then
# echo "unknown vulkan err"
# exit 1
#fi
#Don't exit unless you want to quit the parent script too.
#exit 0

4
subprojects/graphene.wrap

@ -0,0 +1,4 @@
[wrap-git]
directory = graphene
url = https://github.com/ebassi/graphene.git
revision = head
Loading…
Cancel
Save