build: update Makefile

Signed-off-by: YdrMaster <ydrml@hotmail.com>
This commit is contained in:
YdrMaster 2023-02-24 14:14:52 +08:00
parent 514666591e
commit fb3478bf3e
1 changed files with 8 additions and 1 deletions

View File

@ -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