1 --- /src/gyp/defines.gypi
2 +++ /src/gyp/defines.gypi
4 # use_libibus represents if ibus library is used or not.
5 # This option is only for Linux.
8 + # use_libgtest represents if gtest library is used or not.
9 + 'use_libgtest%': '0',
11 + # use_libjsoncpp represents if jsoncpp library is used or not.
12 + 'use_libjsoncpp%': '0',
16 --- /src/net/jsoncpp.gyp
17 +++ /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_libjsoncpp==1', {
39 + 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
41 + 'all_dependent_settings': {
43 + '<@(jsoncpp_additional_macros)',
46 + '<!@(pkg-config --cflags jsoncpp)',
50 + '<!@(pkg-config --libs-only-l jsoncpp)',
53 + '<!@(pkg-config --libs-only-L jsoncpp)',
58 + 'type': 'static_library',
60 + 'jsoncpp_root': '<(third_party_dir)/jsoncpp',
62 + '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
63 + '<(jsoncpp_root)/src/lib_json/json_value.cpp',
64 + '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
66 + 'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
67 + 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
70 + '<@(jsoncpp_additional_macros)',
77 + '<@(jsoncpp_include_dirs)',
79 + 'all_dependent_settings': {
81 + '<@(jsoncpp_additional_macros)',
91 - '<@(jsoncpp_include_dirs)',
93 - 'all_dependent_settings': {
95 - '<@(jsoncpp_additional_macros)',
101 --- /src/net/jsoncpp.h
102 +++ /src/net/jsoncpp.h
104 // Mozc basically disables C++ exception.
105 #define JSON_USE_EXCEPTION 0
106 #endif // !JSON_USE_EXCEPTION
107 -#include "third_party/jsoncpp/include/json/json.h"
108 +#include <json/json.h>
109 #define MOZC_JSONCPP_JSON_H_INCLUDED
110 #endif // !MOZC_JSONCPP_JSON_H_INCLUDED
112 --- /src/testing/testing.gyp
113 +++ /src/testing/testing.gyp
117 'target_name': 'testing',
118 - 'type': 'static_library',
121 - 'GTEST_LANG_CXX11=1',
122 - 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
124 - 'gtest_dir': '<(third_party_dir)/gtest/googletest',
125 - 'gmock_dir': '<(third_party_dir)/gtest/googlemock',
127 - ['_toolset=="target" and target_platform=="Android"', {
129 - 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
130 - 'GTEST_HAS_CLONE=0',
131 - 'GTEST_HAS_GLOBAL_WSTRING=0',
132 - 'GTEST_HAS_POSIX_RE=0',
133 - 'GTEST_HAS_STD_WSTRING=0',
134 - 'GTEST_OS_LINUX=1',
135 - 'GTEST_OS_LINUX_ANDROID=1',
141 - '<(gmock_dir)/src/gmock-cardinalities.cc',
142 - '<(gmock_dir)/src/gmock-internal-utils.cc',
143 - '<(gmock_dir)/src/gmock-matchers.cc',
144 - '<(gmock_dir)/src/gmock-spec-builders.cc',
145 - '<(gmock_dir)/src/gmock.cc',
146 - '<(gtest_dir)/src/gtest-death-test.cc',
147 - '<(gtest_dir)/src/gtest-filepath.cc',
148 - '<(gtest_dir)/src/gtest-port.cc',
149 - '<(gtest_dir)/src/gtest-printers.cc',
150 - '<(gtest_dir)/src/gtest-test-part.cc',
151 - '<(gtest_dir)/src/gtest-typed-test.cc',
152 - '<(gtest_dir)/src/gtest.cc',
156 - '<(gmock_dir)/include',
158 - '<(gtest_dir)/include',
161 - '<@(gtest_defines)',
163 - 'all_dependent_settings': {
165 - '<@(gtest_defines)',
168 - '<(gmock_dir)/include',
169 - '<(gtest_dir)/include',
173 - ['(_toolset=="target" and compiler_target=="clang") or '
174 - '(_toolset=="host" and compiler_host=="clang")', {
176 - '-Wno-missing-field-initializers',
177 - '-Wno-unused-private-field',
178 + ['use_libgtest==1', {
182 + 'GTEST_LANG_CXX11=1',
183 + 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
186 + ['_toolset=="target" and target_platform=="Android"', {
188 + 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
189 + 'GTEST_HAS_CLONE=0',
190 + 'GTEST_HAS_GLOBAL_WSTRING=0',
191 + 'GTEST_HAS_POSIX_RE=0',
192 + 'GTEST_HAS_STD_WSTRING=0',
193 + 'GTEST_OS_LINUX=1',
194 + 'GTEST_OS_LINUX_ANDROID=1',
199 + 'all_dependent_settings': {
201 + '<@(gtest_defines)',
210 + 'type': 'static_library',
213 + 'GTEST_LANG_CXX11=1',
214 + 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
216 + 'gtest_dir': '<(third_party_dir)/gtest/googletest',
217 + 'gmock_dir': '<(third_party_dir)/gtest/googlemock',
219 + ['_toolset=="target" and target_platform=="Android"', {
221 + 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
222 + 'GTEST_HAS_CLONE=0',
223 + 'GTEST_HAS_GLOBAL_WSTRING=0',
224 + 'GTEST_HAS_POSIX_RE=0',
225 + 'GTEST_HAS_STD_WSTRING=0',
226 + 'GTEST_OS_LINUX=1',
227 + 'GTEST_OS_LINUX_ANDROID=1',
233 + '<(gmock_dir)/src/gmock-cardinalities.cc',
234 + '<(gmock_dir)/src/gmock-internal-utils.cc',
235 + '<(gmock_dir)/src/gmock-matchers.cc',
236 + '<(gmock_dir)/src/gmock-spec-builders.cc',
237 + '<(gmock_dir)/src/gmock.cc',
238 + '<(gtest_dir)/src/gtest-death-test.cc',
239 + '<(gtest_dir)/src/gtest-filepath.cc',
240 + '<(gtest_dir)/src/gtest-port.cc',
241 + '<(gtest_dir)/src/gtest-printers.cc',
242 + '<(gtest_dir)/src/gtest-test-part.cc',
243 + '<(gtest_dir)/src/gtest-typed-test.cc',
244 + '<(gtest_dir)/src/gtest.cc',
248 + '<(gmock_dir)/include',
250 + '<(gtest_dir)/include',
253 + '<@(gtest_defines)',
255 + 'all_dependent_settings': {
257 + '<@(gtest_defines)',
260 + '<(gmock_dir)/include',
261 + '<(gtest_dir)/include',
265 + ['(_toolset=="target" and compiler_target=="clang") or '
266 + '(_toolset=="host" and compiler_host=="clang")', {
268 + '-Wno-missing-field-initializers',
269 + '-Wno-unused-private-field',