1 https://github.com/google/mozc/issues/490
3 --- a/src/gyp/defines.gypi
4 +++ b/src/gyp/defines.gypi
6 # use_system_gtest represents if system version or bundled version
7 # of gtest library is used.
8 'use_system_gtest%': '0',
10 + # use_system_jsoncpp represents if system version or bundled version
11 + # of jsoncpp library is used.
12 + 'use_system_jsoncpp%': '0',
16 --- a/src/net/jsoncpp.gyp
17 +++ b/src/net/jsoncpp.gyp
21 'target_name': 'jsoncpp',
22 - 'type': 'static_library',
24 - 'jsoncpp_root': '<(third_party_dir)/jsoncpp',
26 - '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
27 - '<(jsoncpp_root)/src/lib_json/json_value.cpp',
28 - '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
30 - 'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
31 - 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
34 - '<@(jsoncpp_additional_macros)',
36 + ['use_system_jsoncpp==1', {
39 + 'jsoncpp_additional_macros': [
40 + 'JSON_USE_EXCEPTION=0',
41 + 'MOZC_USE_SYSTEM_JSONCPP',
44 + 'all_dependent_settings': {
46 + '<@(jsoncpp_additional_macros)',
49 + '<!@(pkg-config --cflags jsoncpp)',
53 + '<!@(pkg-config --libs-only-l jsoncpp)',
56 + '<!@(pkg-config --libs-only-L jsoncpp)',
61 + 'type': 'static_library',
63 + 'jsoncpp_root': '<(third_party_dir)/jsoncpp',
65 + '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
66 + '<(jsoncpp_root)/src/lib_json/json_value.cpp',
67 + '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
69 + 'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
70 + 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
73 + '<@(jsoncpp_additional_macros)',
80 + '<@(jsoncpp_include_dirs)',
82 + 'all_dependent_settings': {
84 + '<@(jsoncpp_additional_macros)',
94 - '<@(jsoncpp_include_dirs)',
96 - 'all_dependent_settings': {
98 - '<@(jsoncpp_additional_macros)',
104 --- a/src/net/jsoncpp.h
105 +++ b/src/net/jsoncpp.h
107 // Mozc basically disables C++ exception.
108 #define JSON_USE_EXCEPTION 0
109 #endif // !JSON_USE_EXCEPTION
110 +#ifdef MOZC_USE_SYSTEM_JSONCPP
111 +#include <json/json.h>
113 #include "third_party/jsoncpp/include/json/json.h"
115 #define MOZC_JSONCPP_JSON_H_INCLUDED
116 #endif // !MOZC_JSONCPP_JSON_H_INCLUDED