Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 166 lines (164 sloc) 6.173 kb
25a5e90 ry Fix GYP build on OSX
ry authored
1 {
2 'variables': {
b433c42 ry gyp: Support Linux
ry authored
3 'visibility%': 'hidden', # V8's visibility setting
25a5e90 ry Fix GYP build on OSX
ry authored
4 'target_arch%': 'ia32', # set v8's target architecture
5 'host_arch%': 'ia32', # set v8's host architecture
6 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
7 'component%': 'static_library', # NB. these names match with what V8 expects
8 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
9 },
10
11 'target_defaults': {
12 'default_configuration': 'Debug',
13 'configurations': {
14 'Debug': {
15 'defines': [ 'DEBUG', '_DEBUG' ],
16 'cflags': [ '-g', '-O0' ],
17 'msvs_settings': {
18 'VCCLCompilerTool': {
19 'target_conditions': [
20 ['library=="static_library"', {
21 'RuntimeLibrary': 1, # static debug
22 }, {
23 'RuntimeLibrary': 3, # DLL debug
24 }],
25 ],
26 'Optimization': 0, # /Od, no optimization
27 'MinimalRebuild': 'true',
28 'OmitFramePointers': 'false',
29 'BasicRuntimeChecks': 3, # /RTC1
30 },
31 'VCLinkerTool': {
32 'LinkIncremental': 2, # enable incremental linking
33 },
34 },
35 },
36 'Release': {
37 'defines': [ 'NDEBUG' ],
38 'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ],
39 'msvs_settings': {
40 'VCCLCompilerTool': {
41 'target_conditions': [
42 ['library=="static_library"', {
43 'RuntimeLibrary': 0, # static release
44 }, {
45 'RuntimeLibrary': 2, # debug release
46 }],
47 ],
48 'Optimization': 3, # /Ox, full optimization
49 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
50 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
51 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
52 'OmitFramePointers': 'true',
53 'EnableFunctionLevelLinking': 'true',
54 'EnableIntrinsicFunctions': 'true',
55 'AdditionalOptions': [
56 '/MP', # compile across multiple CPUs
57 ],
58 },
59 'VCLibrarianTool': {
60 'AdditionalOptions': [
61 '/LTCG', # link time code generation
62 ],
63 },
64 'VCLinkerTool': {
65 'LinkTimeCodeGeneration': 1, # link-time code generation
66 'OptimizeReferences': 2, # /OPT:REF
67 'EnableCOMDATFolding': 2, # /OPT:ICF
68 'LinkIncremental': 1, # disable incremental linking
69 },
70 },
71 }
72 },
73 'msvs_settings': {
74 'VCCLCompilerTool': {
75 'StringPooling': 'true', # pool string literals
76 'DebugInformationFormat': 3, # Generate a PDB
77 'WarningLevel': 3,
78 'BufferSecurityCheck': 'true',
79 'ExceptionHandling': 1, # /EHsc
80 'SuppressStartupBanner': 'true',
81 'WarnAsError': 'false',
82 },
83 'VCLibrarianTool': {
84 },
85 'VCLinkerTool': {
86 'GenerateDebugInformation': 'true',
87 'RandomizedBaseAddress': 2, # enable ASLR
88 'DataExecutionPrevention': 2, # enable DEP
89 'AllowIsolation': 'true',
90 'SuppressStartupBanner': 'true',
91 },
92 },
93 'conditions': [
94 ['OS == "win"', {
95 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
96 'defines': [
97 'WIN32',
98 # we don't really want VC++ warning us about
99 # how dangerous C functions are...
100 '_CRT_SECURE_NO_DEPRECATE',
101 # ... or that C implementations shouldn't use
102 # POSIX names
103 '_CRT_NONSTDC_NO_DEPRECATE',
104 ],
105 }],
106 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
107 'target_defaults': {
108 'cflags': [ '-Wall', '-pthread', '-fno-rtti', '-fno-exceptions' ],
109 'ldflags': [ '-pthread', ],
110 'conditions': [
111 [ 'target_arch=="ia32"', {
112 'cflags': [ '-m32' ],
113 'ldflags': [ '-m32' ],
114 }],
115 [ 'OS=="linux"', {
116 'cflags': [ '-ansi' ],
117 }],
118 [ 'visibility=="hidden"', {
119 'cflags': [ '-fvisibility=hidden' ],
120 }],
121 ],
122 },
123 }],
124 ['OS=="mac"', {
125 'target_defaults': {
126 'xcode_settings': {
127 'ALWAYS_SEARCH_USER_PATHS': 'NO',
128 'GCC_C_LANGUAGE_STANDARD': 'ansi', # -ansi
129 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
130 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
131 # (Equivalent to -fPIC)
132 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
133 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
134 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
135 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
136 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
137 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
138 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
139 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
140 'GCC_VERSION': '4.2',
141 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
142 'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
143 'PREBINDING': 'NO', # No -Wl,-prebind
144 'USE_HEADERMAP': 'NO',
145 'OTHER_CFLAGS': [
146 '-fno-strict-aliasing',
147 ],
148 'WARNING_CFLAGS': [
149 '-Wall',
150 '-Wendif-labels',
151 '-W',
152 '-Wno-unused-parameter',
153 '-Wnon-virtual-dtor',
154 ],
155 },
156 'target_conditions': [
157 ['_type!="static_library"', {
158 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
159 }],
160 ],
161 },
162 }],
163 ],
164 },
165 }
Something went wrong with that request. Please try again.