xref: /aosp_15_r20/external/openscreen/third_party/jsoncpp/BUILD.gn (revision 3f982cf4871df8771c9d4abe6e9a6f8d829b2736)
1# Copyright 2019 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("//build_overrides/build.gni")
6
7if (build_with_chromium) {
8  source_set("jsoncpp") {
9    public_deps = [ "//third_party/jsoncpp" ]
10  }
11} else {
12  config("jsoncpp_config") {
13    include_dirs = [ "//third_party/jsoncpp/src/include" ]
14
15    cflags_cc = [ "-Wno-implicit-fallthrough" ]
16
17    if (is_clang) {
18      cflags_cc += [ "-Wno-exit-time-destructors" ]
19    }
20  }
21
22  source_set("jsoncpp") {
23    sources = [
24      "src/include/json/allocator.h",
25      "src/include/json/config.h",
26      "src/include/json/forwards.h",
27      "src/include/json/json.h",
28      "src/include/json/json_features.h",
29      "src/include/json/reader.h",
30      "src/include/json/value.h",
31      "src/include/json/version.h",
32      "src/include/json/writer.h",
33      "src/src/lib_json/json_reader.cpp",
34      "src/src/lib_json/json_tool.h",
35      "src/src/lib_json/json_value.cpp",
36      "src/src/lib_json/json_writer.cpp",
37    ]
38
39    public_configs = [ ":jsoncpp_config" ]
40
41    defines = [ "JSON_USE_EXCEPTION=0" ]
42
43    include_dirs = [ "src/src/lib_json" ]
44  }
45}
46