diff --git a/jerry-main/CMakeLists.txt b/jerry-main/CMakeLists.txt index f722485ea9..228601317f 100644 --- a/jerry-main/CMakeLists.txt +++ b/jerry-main/CMakeLists.txt @@ -59,7 +59,11 @@ endmacro() # Jerry with libfuzzer support if(JERRY_LIBFUZZER) jerry_create_executable("jerry-libfuzzer" "libfuzzer.c") - target_link_libraries("jerry-libfuzzer" jerry-port-default -fsanitize=fuzzer) + if(JERRY_OSS_FUZZ) + target_link_libraries("jerry-libfuzzer" jerry-port-default) + else() + target_link_libraries("jerry-libfuzzer" jerry-port-default -fsanitize=fuzzer) + endif() endif() # Jerry standalones diff --git a/tools/build.py b/tools/build.py index e30f00e4ae..6683c17e7b 100755 --- a/tools/build.py +++ b/tools/build.py @@ -96,6 +96,8 @@ def devhelp(helpstring): help=devhelp('build test version of the jerry command line tool (%(choices)s)')) compgrp.add_argument('--libfuzzer', metavar='X', choices=['ON', 'OFF'], type=str.upper, help=devhelp('build jerry with libfuzzer support (%(choices)s)')) + compgrp.add_argument('--oss-fuzz', metavar='X', choices=['ON', 'OFF'], type=str.upper, + help=devhelp('build jerry to run on OSS-fuzz (%(choices)s)')) compgrp.add_argument('--jerry-ext', metavar='X', choices=['ON', 'OFF'], type=str.upper, help='build jerry-ext (%(choices)s)') compgrp.add_argument('--jerry-libm', metavar='X', choices=['ON', 'OFF'], type=str.upper, @@ -188,6 +190,7 @@ def build_options_append(cmakeopt, cliarg): build_options_append('JERRY_CMDLINE_SNAPSHOT', arguments.jerry_cmdline_snapshot) build_options_append('JERRY_CMDLINE_TEST', arguments.jerry_cmdline_test) build_options_append('JERRY_LIBFUZZER', arguments.libfuzzer) + build_options_append('JERRY_OSS_FUZZ', arguments.oss_fuzz) build_options_append('JERRY_EXT', arguments.jerry_ext) build_options_append('JERRY_LIBM', arguments.jerry_libm) build_options_append('JERRY_PORT_DEFAULT', arguments.jerry_port_default)