forked from rime/librime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deps.mk
74 lines (62 loc) · 2 KB
/
deps.mk
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# a minimal build of third party libraries for static linking
rime_root = $(CURDIR)
src_dir = $(rime_root)/deps
glog: build ?= cmake-build
build ?= build
rime_deps = glog gtest leveldb marisa opencc yaml-cpp
.PHONY: all clean-src $(rime_deps)
all: $(rime_deps)
# note: this won't clean output files under include/, lib/ and bin/.
clean-src:
rm -r $(src_dir)/glog/cmake-build || true
rm -r $(src_dir)/googletest/build || true
rm -r $(src_dir)/leveldb/build || true
rm -r $(src_dir)/marisa-trie/build || true
rm -r $(src_dir)/opencc/build || true
rm -r $(src_dir)/yaml-cpp/build || true
glog:
cd $(src_dir)/glog; \
cmake . -B$(build) \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DWITH_GFLAGS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install
gtest:
cd $(src_dir)/googletest; \
cmake . -B$(build) \
-DBUILD_GMOCK:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install
leveldb:
cd $(src_dir)/leveldb; \
cmake . -B$(build) \
-DLEVELDB_BUILD_BENCHMARKS:BOOL=OFF \
-DLEVELDB_BUILD_TESTS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install
marisa:
cd $(src_dir)/marisa-trie; \
cmake $(src_dir) -B$(build) \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install
opencc:
cd $(src_dir)/opencc; \
cmake . -B$(build) \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install
yaml-cpp:
cd $(src_dir)/yaml-cpp; \
cmake . -B$(build) \
-DYAML_CPP_BUILD_CONTRIB:BOOL=OFF \
-DYAML_CPP_BUILD_TESTS:BOOL=OFF \
-DYAML_CPP_BUILD_TOOLS:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install