generated from rdong8/cpp_project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (42 loc) · 1.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
PROJECT = learn_asio
CC = clang
CXX = clang++
BUILD_DIR = build
BUILD_TYPE = Debug
.PHONY: system-deps
system-deps:
sudo dnf install llvm compiler-rt cmake doxygen
.PHONY: py-deps
py-deps: requirements.txt
pyenv virtualenv 3.12.1 ${PROJECT}
pyenv local ${PROJECT}
pip install -r requirements.txt
.PHONY: conan-profile
conan-profile:
conan profile detect --force
.PHONY: conan-deps
conan-deps:
conan install . --build=missing --settings=build_type=${BUILD_TYPE}
.PHONY: cmake-config
cmake-config:
cmake -S . -B ${BUILD_DIR} -G "Ninja Multi-Config" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_MAKE_PROGRAM=ninja \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_TOOLCHAIN_FILE=${BUILD_DIR}/${BUILD_TYPE}/generators/conan_toolchain.cmake
.PHONY: build
build:
cmake --build ${BUILD_DIR}
.PHONY: run
run:
./${BUILD_DIR}/src/${BUILD_TYPE}/${PROJECT}
.PHONY: test
test:
cd ${BUILD_DIR}/ && ctest --extra-verbose -C ${BUILD_TYPE}
.PHONY: docs
docs:
cd ${BUILD_DIR}/ && ninja docs
.PHONY: pre-commit
pre-commit:
pre-commit install