1
# Copyright 2010, Google Inc.
4
# Redistribution and use in source and binary forms, with or without
5
# modification, are permitted provided that the following conditions are
8
# * Redistributions of source code must retain the above copyright
9
# notice, this list of conditions and the following disclaimer.
10
# * Redistributions in binary form must reproduce the above
11
# copyright notice, this list of conditions and the following disclaimer
12
# in the documentation and/or other materials provided with the
14
# * Neither the name of Google Inc. nor the names of its
15
# contributors may be used to endorse or promote products derived from
16
# this software without specific prior written permission.
18
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
# Please don't directly include this file since the gypi files is
32
# automatically included.
33
# You may find cool techniques in the following *.gypi file.
34
# http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi
37
# Define default values in the inner 'variables' dict. This looks
38
# weird but necessary.
40
# By default, we build mozc in two passes to avoid unnecessary code
41
# generation. For instance, it takes quite some time to generate
42
# embedded_dictionary_data.h. If we build mozc in one pass, we end up
43
# invoking the code generation every time code used in the code
44
# generation tool is changed. In fact, a comment fix in 'base/util.h'
45
# causes the code generation. We want to avoid that.
48
'two_pass_build%': '<(two_pass_build)',
50
# warning_cflags_cflags will be shared with Mac and Linux.
54
'-Wno-char-subscripts',
58
# gcc_cflags_cflags will be shared with Mac and Linux.
61
'-fno-omit-frame-pointer',
62
'-fno-strict-aliasing',
64
'-include base/namespace.h',
68
'<(DEPTH)/../third_party/platformsdk/v6_1/files/Lib',
69
'<(DEPTH)/../third_party/atlmfc_vc80/files/lib',
70
'<(DEPTH)/../third_party/vc_80/files/vc/lib',
73
'<(DEPTH)/../third_party/platformsdk/v6_1/files/lib/x64',
74
'<(DEPTH)/../third_party/atlmfc_vc80/files/lib/amd64',
75
'<(DEPTH)/../third_party/vc_80/files/vc/lib/amd64',
77
# We wanted to have this directory under the build output directory
78
# (ex. 'out' for Linux), but there is no variable defined for the top
79
# level source directory, hence we create the directory in the top
80
# level source directory.
81
'mozc_build_tools_dir': '<(DEPTH)/mozc_build_tools/<(OS)',
82
'proto_out_dir': '<(SHARED_INTERMEDIATE_DIR)/proto_out',
87
# See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
88
'mac_release_optimization%': '2', # Use -O2 unless overridden
89
'mac_debug_optimization%': '0', # Use -O0 unless overridden
90
# See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
91
'win_release_optimization%': '2', # 2 = /Os
92
'win_debug_optimization%': '0', # 0 = /Od
93
# See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
94
'win_release_static_crt%': '0', # 0 = /MT (nondebug static)
95
'win_debug_static_crt%': '1', # 1 = /MTd (debug static)
96
'win_release_dynamic_crt%': '2', # 2 = /MD (nondebug dynamic)
97
'win_debug_dynamic_crt%': '3', # 3 = /MDd (debug dynamic)
98
# See http://msdn.microsoft.com/en-us/library/aa652352(VS.71).aspx
99
'win_target_machine_x86%': '1',
100
'win_target_machine_x64%': '17',
101
# See http://msdn.microsoft.com/en-us/library/aa652256(VS.71).aspx
102
'win_char_set_not_set%': '0',
103
'win_char_set_unicode%': '1',
104
'win_char_set_mbcs%': '2',
105
# Extra cflags for gcc
106
'release_extra_cflags%': ['-O2'],
107
'debug_extra_cflags%': ['-O0', '-g'],
112
'msvs_configuration_attributes': {
113
'CharacterSet': '<(win_char_set_unicode)',
116
['branding=="GoogleJapaneseInput"', {
117
'defines': ['GOOGLE_JAPANESE_INPUT_BUILD'],
119
'defines': ['MOZC_BUILD'],
127
'AdditionalLibraryDirectories': [
130
'AdditionalLibraryDirectories!': [
135
'TargetMachine': '<(win_target_machine_x86)',
136
'AdditionalOptions': [
139
'AdditionalLibraryDirectories': [
142
'AdditionalLibraryDirectories!': [
147
'msvs_configuration_attributes': {
148
'OutputDirectory': '<(DEPTH)/out_win/$(ConfigurationName)',
149
'IntermediateDirectory': '<(DEPTH)/out_win/$(ConfigurationName)/obj/$(ProjectName)',
151
'msvs_configuration_platform': 'Win32',
155
'msvs_configuration_attributes': {
156
'OutputDirectory': '<(DEPTH)/out_win/$(ConfigurationName)64',
157
'IntermediateDirectory': '<(DEPTH)/out_win/$(ConfigurationName)64/obj/$(ProjectName)',
159
'msvs_configuration_platform': 'x64',
162
'AdditionalLibraryDirectories': [
165
'AdditionalLibraryDirectories!': [
170
'TargetMachine': '<(win_target_machine_x64)',
171
'AdditionalLibraryDirectories': [
174
'AdditionalLibraryDirectories!': [
183
'COPY_PHASE_STRIP': 'NO',
184
'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
185
'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
188
'VCCLCompilerTool': {
189
'Optimization': '<(win_debug_optimization)',
190
'PreprocessorDefinitions': ['_DEBUG'],
191
'BasicRuntimeChecks': '3',
192
'RuntimeLibrary': '<(win_debug_static_crt)',
194
'VCResourceCompilerTool': {
195
'PreprocessorDefinitions': ['_DEBUG'],
201
'<@(debug_extra_cflags)',
213
'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
214
'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
215
'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
218
'VCCLCompilerTool': {
219
'Optimization': '<(win_release_optimization)',
220
'RuntimeLibrary': '<(win_release_static_crt)',
226
'<@(release_extra_cflags)',
236
'IGNORE_INVALID_FLAG'
238
'msvs_configuration_attributes': {
239
'WholeProgramOptimization': '1',
243
# /PDBALTPATH is documented in Visual C++ 2010
244
# http://msdn.microsoft.com/en-us/library/dd998269(VS.100).aspx
245
'AdditionalOptions': ['/PDBALTPATH:%_PDB%'],
250
# Concrete configurations
253
'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
256
'inherit_from': ['Common_Base', 'x86_Base', 'Optimize_Base'],
259
'inherit_from': ['Optimize', 'Release_Base'],
264
'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
267
'inherit_from': ['Common_Base', 'x64_Base', 'Optimize_Base'],
270
'inherit_from': ['Optimize_x64', 'Release_Base'],
275
'default_configuration': 'Debug',
278
'GTEST_HAS_TR1_TUPLE=0',
281
'MOZC_DATA_DIR="<(SHARED_INTERMEDIATE_DIR)"',
286
'<(DEPTH)/third_party/gtest',
287
'<(DEPTH)/third_party/gtest/include',
288
'<(DEPTH)/third_party/breakpad/src',
289
'<(SHARED_INTERMEDIATE_DIR)',
290
'<(SHARED_INTERMEDIATE_DIR)/proto_out',
291
'../protobuf/files/src',
304
'_ATL_APARTMENT_THREADED',
305
'_ATL_CSTRING_EXPLICIT_CONSTRUCTORS',
307
'_CRT_SECURE_NO_DEPRECATE',
308
'_MIDL_USE_GUIDDEF_',
313
'_WIN32_WINDOWS=0x0410',
314
'_WIN32_WINNT=0x0501',
319
'<(DEPTH)/../third_party/platformsdk/v6_1/files/include',
320
'<(DEPTH)/../third_party/wtl_80/files/include',
321
'<(DEPTH)/../third_party/atlmfc_vc80/files/include',
322
'<(DEPTH)/../third_party/vc_80/files/vc/include'
324
# We don't have cygwin in our tree, but we need to have
325
# setup_env.bat in the directory specified in 'msvs_cygwin_dirs'
326
# for GYP to be happy.
327
'msvs_cygwin_dirs': [
331
'VCCLCompilerTool': {
332
'BufferSecurityCheck': 'True', # /GS
333
'CompileAs': '2', # /TP
334
'CompileOnly': 'True', # /c
335
'DebugInformationFormat': '3', # /Zi
336
'DefaultCharIsUnsigned': 'True', # /J
337
'DisableSpecificWarnings': ['4018', '4150', '4722'],
339
'EnableFunctionLevelLinking': 'True', # /Gy
340
'EnableIntrinsicFunctions': 'True', # /Oi
341
'ExceptionHandling': '2', # /EHs
342
'ForcedIncludeFiles': ['base/namespace.h'],
344
'OptimizeForWindows98': '1', # /OPT:NOWIN98
345
'OmitFramePointers': 'False', # /Oy-
346
'SuppressStartupBanner': 'True', # /nologo
347
'TreatWChar_tAsBuiltInType': 'False', # /Zc:wchar_t-
348
'WarningLevel': '3', # /W3
351
# TODO(satorux): Reduce the number of libraries. We should
352
# only have common libraries here.
353
'AdditionalDependencies': [
377
'AdditionalOptions': [
378
'/DYNAMICBASE', # 'RandomizedBaseAddress': 'True'
381
'EnableCOMDATFolding': '2', # /OPT:ICF
382
'GenerateDebugInformation': 'True', # /DEBUG
383
'LinkIncremental': '1', # /INCREMENTAL:NO
384
'OptimizeReferences': '2', # /OPT:REF
385
'TerminalServerAware': '2', # /TSAWARE
387
'VCResourceCompilerTool': {
388
# TODO(yukawa): embed version info via command line parameters.
389
'PreprocessorDefinitions': [
390
'MOZC_RES_USE_TEMPLATE=1',
391
'MOZC_RES_FILE_VERSION_NUMBER="0,0,1,9999"',
392
'MOZC_RES_PRODUCT_VERSION_NUMBER="0,0,1,9999"',
393
'MOZC_RES_FILE_VERSION_STRING="""0.0.1.9999"""',
394
'MOZC_RES_PRODUCT_VERSION_STRING="""0.0.1.9999"""',
395
'MOZC_RES_COMPANY_NAME="""Google Inc."""',
396
'MOZC_RES_LEGAL_COPYRIGHT="""Copyright (C) 2010 Google Inc. All Rights Reserved."""',
398
'AdditionalIncludeDirectories': ['<(DEPTH)'],
424
'mac_framework_dirs': [
425
'<(DEPTH)/../mac/Releases/GoogleBreakpad',
428
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
432
'WARNING_CFLAGS': ['<@(warning_cflags)'],
436
'$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
437
'$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
438
'$(SDKROOT)/System/Library/Frameworks/Security.framework',
439
'$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
440
'/usr/lib/libcrypto.dylib',
441
'/usr/lib/libcurl.dylib',
442
'/usr/lib/libiconv.dylib',
443
'/usr/lib/libssl.dylib',
444
'/usr/lib/libz.dylib',