This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
/
common.gypi
167 lines (167 loc) · 5.89 KB
/
common.gypi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#
# Common build configuration
# ==========================
#
# GYP include file with common configuration settings.
#
# Attribution Notice:
# This work might use parts of Node.js `common.gypi` (https://github.com/joyent/node).
#
{
'variables': {
'target_arch%': 'ia32',
'libdrafter_type%': 'static_library'
},
'target_defaults': {
'defines': [
'BUILDING_DRAFTER=1'
],
'configurations': {
'Debug': {
'defines': [ 'DEBUG', '_DEBUG', 'LOGGING' ],
'cflags': [ '-g', '-O0' ],
'conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
],
'msvs_settings': {
'VCCLCompilerTool': {
'PreprocessorDefinitions': ['_SECURE_SCL=0', '_HAS_ITERATOR_DEBUGGING=0' ], # https://github.com/xbmc/xbmc/pull/1009
'RuntimeLibrary': 3, # dll debug
'Optimization': 0, # /Od, no optimization
'MinimalRebuild': 'false',
'OmitFramePointers': 'false',
'BasicRuntimeChecks': 3, # /RTC1
'RuntimeTypeInfo': 'true', # /GR, determine object type at runtime
'DebugInformationFormat': 3, # /Zi, use program database as debugging information
'ExceptionHandling': 1
},
'VCLinkerTool': {
'LinkIncremental': 2, # enable incremental linking
'GenerateDebugInformation': 'true', # /DEBUG enable line by line debugging
'SubSystem': 1 # /SUBSYSTEM:CONSOLE use console as native environment
},
},
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
}
},
'Release': {
'defines': [ 'NDEBUG' ],
'cflags': [ '-O3' ],
'conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 2, # dll release
'Optimization': 0, # /Od, no optimizations
'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
'OmitFramePointers': 'true',
'EnableFunctionLevelLinking': 'true',
'EnableIntrinsicFunctions': 'true',
'RuntimeTypeInfo': 'true', # /GR, determine object type at runtime
'ExceptionHandling': 1,
'AdditionalOptions': [
'/MP', # compile across multiple CPUs
]
},
'VCLibrarianTool': {
'AdditionalOptions': [
'/LTCG', # link time code generation
],
},
'VCLinkerTool': {
'LinkTimeCodeGeneration': 1, # link-time code generation
'OptimizeReferences': 2, # /OPT:REF
'EnableCOMDATFolding': 2, # /OPT:ICF
'LinkIncremental': 1, # disable incremental linking
'SubSystem': 1 # /SUBSYSTEM:CONSOLE use console as native environment
}
}
}
},
'conditions': [
['OS == "win"', {
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
'defines': [
'WIN32',
# we don't really want VC++ warning us about
# how dangerous C functions are...
'_CRT_SECURE_NO_DEPRECATE',
# ... or that C implementations shouldn't use
# POSIX names
'_CRT_NONSTDC_NO_DEPRECATE'
],
}],
[ 'OS in "linux freebsd openbsd solaris"', {
'cflags': [ '-fPIC' ],
}],
[ 'OS in "linux freebsd openbsd solaris android"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-Wno-comment' ],
'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ],
'cflags_cc': [ '-std=c++14' ],
'ldflags': [ '-rdynamic' ],
'target_conditions': [
['_type=="static_library"', {
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
}],
],
'conditions': [
[ 'target_arch=="ia32"', {
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
[ 'target_arch=="x64"', {
'cflags': [ '-m64' ],
'ldflags': [ '-m64' ],
}]
]
}],
['OS=="mac"', {
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # !-fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'YES', # !-fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'YES', # No -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'MACOSX_DEPLOYMENT_TARGET': '10.7', # -mmacosx-version-min=10.7
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
],
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14',
'CLANG_CXX_LIBRARY': 'libc++',
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
],
},
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
}],
],
'conditions': [
['target_arch=="ia32"', {
'xcode_settings': {'ARCHS': ['i386']},
}],
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
],
}]
],
}
}