2022-12-24 14:33:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-08-24 22:30:20 +00:00
|
|
|
BINDIR=bin
|
|
|
|
LIBDIR=../../build/bin
|
|
|
|
RESDIR=../resources
|
2022-12-24 14:33:32 +00:00
|
|
|
SRCDIR=../../src
|
|
|
|
|
|
|
|
INCLUDES="-I$SRCDIR -I$SRCDIR/util -I$SRCDIR/platform -I$SRCDIR/app"
|
2023-08-24 22:30:20 +00:00
|
|
|
LIBS="-L$LIBDIR -lorca -framework Foundation -framework Metal"
|
2023-08-14 08:26:11 +00:00
|
|
|
FLAGS="-mmacos-version-min=10.15.4 -DOC_DEBUG -DLOG_COMPILE_DEBUG"
|
2022-12-24 14:33:32 +00:00
|
|
|
|
2023-08-24 22:30:20 +00:00
|
|
|
mkdir -p $BINDIR
|
|
|
|
clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_metal_triangle main.m
|
|
|
|
|
2022-12-26 17:33:31 +00:00
|
|
|
xcrun -sdk macosx metal -c -o shader.air shader.metal
|
|
|
|
xcrun -sdk macosx metallib -o shader.metallib shader.air
|
2023-08-24 22:30:20 +00:00
|
|
|
mv shader.air $BINDIR/
|
2022-12-26 17:33:31 +00:00
|
|
|
|
2023-08-24 22:30:20 +00:00
|
|
|
cp $LIBDIR/liborca.dylib $BINDIR/
|
|
|
|
cp $LIBDIR/mtl_renderer.metallib $BINDIR/
|
|
|
|
cp shader.metallib $BINDIR/triangle_shader.metallib
|
2023-06-20 09:45:59 +00:00
|
|
|
|
|
|
|
install_name_tool -add_rpath "@executable_path" $BINDIR/example_metal_triangle
|