1# Copyright 2014 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import("//testing/libfuzzer/fuzzer_test.gni") 6 7config("jsoncpp_config") { 8 include_dirs = [ 9 "source/include", 10 "generated", 11 ] 12 13 # TODO(crbug.com/983223): Update JsonCpp BUILD.gn to remove deprecated 14 # declaration flag. 15 # This temporary flag allowing clients to update to the new version, and then 16 # update to the new StreamWriter and CharReader classes. 17 if (!is_win || is_clang) { 18 cflags_cc = [ "-Wno-deprecated-declarations" ] 19 } 20} 21 22source_set("jsoncpp") { 23 sources = [ 24 "generated/version.h", 25 "source/include/json/assertions.h", 26 "source/include/json/autolink.h", 27 "source/include/json/config.h", 28 "source/include/json/features.h", 29 "source/include/json/forwards.h", 30 "source/include/json/json.h", 31 "source/include/json/reader.h", 32 "source/include/json/value.h", 33 "source/include/json/writer.h", 34 "source/src/lib_json/json_reader.cpp", 35 "source/src/lib_json/json_tool.h", 36 "source/src/lib_json/json_value.cpp", 37 "source/src/lib_json/json_writer.cpp", 38 ] 39 40 public_configs = [ ":jsoncpp_config" ] 41 42 defines = [ 43 "JSON_USE_EXCEPTION=0", 44 "JSON_USE_NULLREF=0", 45 ] 46 47 include_dirs = [ "source/src/lib_json" ] 48 49 if (!is_win || is_clang) { 50 cflags_cc = [ "-Wno-implicit-fallthrough" ] 51 } 52} 53 54if (build_with_chromium) { 55 fuzzer_test("jsoncpp_fuzzer") { 56 sources = [ "fuzzers/json_fuzzer.cc" ] 57 58 deps = [ ":jsoncpp" ] 59 60 include_dirs = [ "generated" ] 61 62 dict = "//testing/libfuzzer/fuzzers/dicts/json.dict" 63 } 64} 65