blob: 8a4b8c3d10b6f10767a9f654894fbbc4a55379d7 [file] [log] [blame]
Dan Albert36b6f042015-07-30 16:56:30 -07001###########################################
2## A thin wrapper around BUILD_EXECUTABLE
3## Common flags for fuzz tests are added.
4###########################################
Dan Willemsen3bf15e72016-07-25 16:03:53 -07005$(call record-module-type,FUZZ_TEST)
Dan Albert36b6f042015-07-30 16:56:30 -07006
7ifdef LOCAL_SDK_VERSION
8 $(error $(LOCAL_PATH): $(LOCAL_MODULE): NDK fuzz tests are not supported.)
9endif
10
Zach Riggle6319dee2017-12-21 16:04:03 -060011my_fuzzer:=libFuzzer
12ifdef LOCAL_FUZZ_ENGINE
13 my_fuzzer:=$(LOCAL_FUZZ_ENGINE)
14else ifdef TARGET_FUZZ_ENGINE
15 my_fuzzer:=$(TARGET_FUZZ_ENGINE)
16endif
17
Mitch Phillipsee8f4a02019-05-01 14:37:33 -070018LOCAL_SANITIZE += fuzzer
Zach Riggle6319dee2017-12-21 16:04:03 -060019
20ifeq ($(my_fuzzer),libFuzzer)
Dan Austin5567e502017-04-19 10:56:45 -070021LOCAL_STATIC_LIBRARIES += libFuzzer
Zach Riggle6319dee2017-12-21 16:04:03 -060022else
23$(call pretty-error, Unknown fuzz engine $(my_fuzzer))
24endif
Dan Albert36b6f042015-07-30 16:56:30 -070025
26ifdef LOCAL_MODULE_PATH
27$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH when building test $(LOCAL_MODULE))
28endif
29
30ifdef LOCAL_MODULE_PATH_32
31$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_32 when building test $(LOCAL_MODULE))
32endif
33
34ifdef LOCAL_MODULE_PATH_64
35$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE))
36endif
37
Zach Riggle70299e92018-03-26 14:47:31 -050038LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(my_fuzzer)/$(LOCAL_MODULE)
39LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(my_fuzzer)/$(LOCAL_MODULE)
Dan Albert36b6f042015-07-30 16:56:30 -070040
Zach Rigglebcfa37e2018-01-03 13:32:14 -060041ifndef LOCAL_STRIP_MODULE
42LOCAL_STRIP_MODULE := keep_symbols
43endif
44
Dan Albert36b6f042015-07-30 16:56:30 -070045include $(BUILD_EXECUTABLE)