aboutsummaryrefslogtreecommitdiffstats
path: root/ffbuild
diff options
context:
space:
mode:
authorAman Karmani <aman@tmm1.net>2021-12-16 11:28:01 -0800
committerAman Karmani <aman@tmm1.net>2021-12-18 11:55:47 -0800
commitc975946577f08cea35b2a94c0deecb4dd32a7e20 (patch)
tree3767d67ed87292ac84b69679f771c50cc16f112f /ffbuild
parentad3c19dc9ef806c3ddbcc7b9c93d1ebaf14dd6e4 (diff)
downloadffmpeg-c975946577f08cea35b2a94c0deecb4dd32a7e20.tar.gz
build: detect Metal.framework and build .metal files
Reviewed-by: Ridley Combs <rcombs@rcombs.me> Signed-off-by: Aman Karmani <aman@tmm1.net>
Diffstat (limited to 'ffbuild')
-rw-r--r--ffbuild/common.mak9
1 files changed, 9 insertions, 0 deletions
diff --git a/ffbuild/common.mak b/ffbuild/common.mak
index 0eb831d434..e79b509425 100644
--- a/ffbuild/common.mak
+++ b/ffbuild/common.mak
@@ -112,6 +112,15 @@ COMPILE_LASX = $(call COMPILE,CC,LASXFLAGS)
$(BIN2CEXE): ffbuild/bin2c_host.o
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
+%.metal.air: %.metal
+ $(METALCC) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) -o $@
+
+%.metallib: %.metal.air
+ $(METALLIB) --split-module-without-linking $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) -o $@
+
+%.metallib.c: %.metallib $(BIN2CEXE)
+ $(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst .,_,$(basename $(notdir $@)))
+
%.ptx: %.cu $(SRC_PATH)/compat/cuda/cuda_runtime.h
$(COMPILE_NVCC)