-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbru_common.gypi
executable file
·172 lines (169 loc) · 7.35 KB
/
bru_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
168
169
170
171
172
{
# Explicit default options for MSVC builds. Gyp itself does not
# specify a lot of default project options for MSVC, to the point that
# a simple type="executable" target won't even link with error
# LNK1561 entry point must be defined
# because of missing /SUBSYSTEM:CONSOLE linker option.
#
# These defaults here were copied partially from
# https://github.com/joyent/node/blob/v0.10.26/common.gypi#L151
"variables": {
# That's for switching between 32bit and 64bit builds with msvc
# on Windows.
# E.g. switch to that via
# >set GYP_DEFINES=target_arch=x64
# See also https://code.google.com/p/libyuv/wiki/GettingStarted
# Alternatively we could allow switching between 32/64 bit
# compilation via "configurations", but since libuv and nodejs
# builds don't do that let's not bother doing this here either for now.
"target_arch%": "ia32"
},
"target_defaults": {
# To build config Debug with 'make' run:
# >make BUILDTYPE=Debug
# To build config Debug it with msbuild run:
# >msbuild *.sln /p:Configuration=Debug
"default_configuration": "Release",
# List two configs: Debug & Release:
"configurations": {
"Debug": {
"defines": [ "DEBUG", "_DEBUG" ],
"cflags": [ "-g", "-O0" ],
"conditions": [
["target_arch=='x64'", {
"msvs_configuration_platform": "x64",
}],
['OS=="mac"', {
'xcode_settings': {
'OTHER_CFLAGS' : ' -fvisibility=hidden -fembed-bitcode',
}, # xcode_settings
}],
['OS=="iOS"', {
'xcode_settings': {
'SDKROOT': 'iphoneos',
'TARGETED_DEVICE_FAMILY': '1,2',
'CODE_SIGN_IDENTITY': 'iPhone Developer',
'IPHONEOS_DEPLOYMENT_TARGET': '8.0',
'ARCHS': '$(ARCHS_STANDARD_32_64_BIT) armv7s',
'OTHER_CFLAGS' : ' -fvisibility=hidden -fembed-bitcode',
}, # xcode_settings
}]
],
"msvs_settings": {
"VCCLCompilerTool": {
"RuntimeLibrary": 1, #static debug /MTd
"Optimization": 0, #/Od, no optimization
"MinimalRebuild": "false",
"OmitFramePointers": "false",
"BasicRuntimeChecks": 3, #/RTC1
},
"VCLinkerTool": {
"LinkIncremental": 1, # 2 would enable, but conflicts with LTCG
},
},
"xcode_settings": {
"GCC_OPTIMIZATION_LEVEL " : "0", #stop gyp from defaulting to - Os
"CONFIGURATION_BUILD_DIR" : "../../bru_modules/lib/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
"OBJROOT" : "bru_build"
},
},
"Release": {
"defines": [
# should we add this here or not? E.g. rcf won't compile
# unless NDEBUG is set for release builds. This is more of
# a Windows/msvs thing than a Linux thing. Let's have
# downstream projects set this explicitly if they require
# it? Or just set it here? Let's set here for now:
"NDEBUG"
],
"cflags": [
"-O2",
#? "-fno-strict-aliasing",
"-ffunction-sections", "-fdata-sections" ],
"ldflags": [ "-Wl,--gc-sections" ],
"conditions": [
["target_arch=='x64'", {
"msvs_configuration_platform": "x64",
}],
['OS=="mac"', {
'xcode_settings': {
'OTHER_CFLAGS' : ' -fvisibility=hidden -fembed-bitcode',
}, # xcode_settings
}],
['OS=="iOS"', {
'xcode_settings': {
'SDKROOT': 'iphoneos',
'TARGETED_DEVICE_FAMILY': '1,2',
'CODE_SIGN_IDENTITY': 'iPhone Developer',
'IPHONEOS_DEPLOYMENT_TARGET': '8.0',
'ARCHS': '$(ARCHS_STANDARD_32_64_BIT) armv7s',
'OTHER_CFLAGS' : ' -fvisibility=hidden -fembed-bitcode',
}, # xcode_settings
}]
],
"msvs_settings": {
"VCCLCompilerTool": {
"RuntimeLibrary": 0, # static release
"Optimization": 3, # /Ox, full optimization
"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"
}
},
"xcode_settings": {
"CONFIGURATION_BUILD_DIR" : "../../bru_modules/lib/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
"OBJROOT" : "bru_build"
},
"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
},
}
},
# now settings that are identical across configurations Debug/Release
"msvs_settings": {
"VCCLCompilerTool": {
"StringPooling": "true", # pool string literals
"DebugInformationFormat": 3, # Generate a PDB
"WarningLevel": 3,
"BufferSecurityCheck": "true",
"ExceptionHandling": 1, # /EHsc
"SuppressStartupBanner": "true",
"WarnAsError": "false"
#"RuntimeTypeInfo": "false",
},
"VCLinkerTool": {
"conditions": [
["target_arch=='x64'", {
"TargetMachine" : 17 # /MACHINE:X64
}]
],
"GenerateDebugInformation": "true",
#"RandomizedBaseAddress": 2, # enable ASLR
#"DataExecutionPrevention": 2, # enable DEP
#"AllowIsolation": "true",
"SuppressStartupBanner": "true",
"LinkTimeCodeGeneration": 1, # link-time code generation
"OptimizeReferences": 2, # /OPT:REF
"EnableCOMDATFolding": 2, # /OPT:ICF
"LinkIncremental": 1, # disable incremental linking
#"ImageHasSafeExceptionHandlers": "false", # /SAFESEH:NO
"target_conditions": [
["_type=='executable'", {
"SubSystem": 1 # console executable
}]
]
}
}
}
}