Skip to content

Commit 47a9982

Browse files
committed
Mark libfly library as a dependency of tests and benchmarks
flymake now supports inter-target dependencies. Mark libfly as a dependency of libfly_benchmarks and libfly_unit_tests. This will automatically link libfly.a into these targets, and means these targets do not need to list out each libfly source directory.
1 parent aafce25 commit 47a9982

File tree

3 files changed

+15
-43
lines changed

3 files changed

+15
-43
lines changed

bench/files.mk

+5-17
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
1-
SRC_DIRS_$(d) := \
2-
fly/coders \
3-
fly/coders/base64 \
4-
fly/coders/huffman \
5-
fly/logger \
6-
fly/parser \
7-
fly/system \
8-
fly/task \
9-
fly/types/bit_stream \
10-
fly/types/bit_stream/detail \
11-
fly/types/json \
12-
bench/util \
13-
test/util
14-
15-
# Include the directories containing the benchmark tests.
161
SRC_DIRS_$(d) += \
172
bench/coders \
183
bench/json \
19-
bench/string
4+
bench/string \
5+
bench/util \
6+
test/util
207

218
SRC_$(d) := \
229
$(d)/main.cpp
2310

24-
CXXFLAGS_$(d) += -I$(SOURCE_ROOT)/test/Catch2/single_include
11+
# All benchmarks should have Catch2 on the include path.
2512
CXXFLAGS_$(d) += \
13+
-I$(SOURCE_ROOT)/test/Catch2/single_include \
2614
-DCATCH_CONFIG_PREFIX_ALL \
2715
-DCATCH_CONFIG_FAST_COMPILE \
2816
-DCATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER

build/nix/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ include /usr/local/src/fly/api.mk
1111
$(eval $(call ADD_TARGET, libfly, fly, LIB))
1212

1313
# Test targets.
14-
$(eval $(call ADD_TARGET, libfly_unit_tests, test, TEST))
15-
$(eval $(call ADD_TARGET, libfly_benchmarks, bench, BIN))
14+
$(eval $(call ADD_TARGET, libfly_unit_tests, test, TEST, libfly))
15+
$(eval $(call ADD_TARGET, libfly_benchmarks, bench, BIN, libfly))
1616

1717
# Paths to ignore during code coverage reporting.
1818
#

test/files.mk

+8-24
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
SRC_DIRS_$(d) := \
2-
fly/coders \
3-
fly/coders/base64 \
4-
fly/coders/huffman \
5-
fly/config \
6-
fly/logger \
7-
fly/parser \
8-
fly/path \
9-
fly/socket \
10-
fly/system \
11-
fly/task \
12-
fly/types/bit_stream \
13-
fly/types/bit_stream/detail \
14-
fly/types/json \
15-
test/util
16-
17-
ifeq ($(SYSTEM), LINUX)
18-
SRC_DIRS_$(d) += \
19-
test/mock
20-
endif
21-
22-
# Include the directories containing the unit tests.
231
SRC_DIRS_$(d) += \
242
test/coders \
253
test/config \
@@ -34,15 +12,21 @@ SRC_DIRS_$(d) += \
3412
test/types/concurrency \
3513
test/types/json \
3614
test/types/numeric \
37-
test/types/string
15+
test/types/string \
16+
test/util
17+
18+
ifeq ($(SYSTEM), LINUX)
19+
SRC_DIRS_$(d) += \
20+
test/mock
21+
endif
3822

3923
SRC_$(d) := \
4024
$(d)/fly.cpp \
4125
$(d)/main.cpp
4226

4327
# All unit tests should have Catch2 on the include path.
44-
CXXFLAGS_$(d) += -I$(SOURCE_ROOT)/test/Catch2/single_include
4528
CXXFLAGS_$(d) += \
29+
-I$(SOURCE_ROOT)/test/Catch2/single_include \
4630
-DCATCH_CONFIG_PREFIX_ALL \
4731
-DCATCH_CONFIG_FAST_COMPILE \
4832
-DCATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER

0 commit comments

Comments
 (0)