From fb3478bf3e395cd5b7d54d81937e3d95b1344250 Mon Sep 17 00:00:00 2001 From: YdrMaster Date: Fri, 24 Feb 2023 14:14:52 +0800 Subject: [PATCH] build: update Makefile Signed-off-by: YdrMaster --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 71033bbb..3661da78 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,17 @@ .PHONY : build clean install-python test-cpp test-onnx TYPE ?= release +CUDA ?= off + +CMAKE_OPT = -DCMAKE_BUILD_TYPE=$(TYPE) + +ifeq ($(CUDA), on) + CMAKE_OPT += -DUSE_CUDA=ON +endif build: mkdir -p build/$(TYPE) - cd build/$(TYPE) && cmake -DCMAKE_BUILD_TYPE=$(TYPE) ../.. && make -j8 + cd build/$(TYPE) && cmake $(CMAKE_OPT) ../.. && make -j8 clean: rm -rf build