3 'visibility%': 'hidden',
4 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
5 'component%': 'static_library',
11 'default_configuration': 'Debug',
15 'defines': [ 'DEBUG', '_DEBUG' ],
16 'cflags': [ '-g', '-O0' ],
19 'target_conditions': [
20 ['library=="static_library"', {
21 'RuntimeLibrary': 1 # static debug
23 'RuntimeLibrary': 3 # DLL debug
26 'Optimization': 0, # /Od, no optimization
27 'MinimalRebuild': 'false',
28 'OmitFramePointers': 'false',
29 'BasicRuntimeChecks': 3 # /RTC1
32 'LinkIncremental': 2 # enable incremental linking
36 'GCC_OPTIMIZATION_LEVEL': '0'
41 'defines': [ 'NDEBUG' ],
44 '-fomit-frame-pointer',
50 'target_conditions': [
51 ['library=="static_library"', {
52 'RuntimeLibrary': 0, # static release
54 'RuntimeLibrary': 2, # debug release
57 'Optimization': 3, # /Ox, full optimization
58 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
59 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
60 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
61 'OmitFramePointers': 'true',
62 'EnableFunctionLevelLinking': 'true',
63 'EnableIntrinsicFunctions': 'true'
66 'AdditionalOptions': [
67 '/LTCG' # link time code generation
71 'LinkTimeCodeGeneration': 1, # link-time code generation
72 'OptimizeReferences': 2, # /OPT:REF
73 'EnableCOMDATFolding': 2, # /OPT:ICF
74 'LinkIncremental': 1 # disable incremental linking
82 'StringPooling': 'true', # pool string literals
83 'DebugInformationFormat': 3, # Generate a PDB
85 'BufferSecurityCheck': 'true',
86 'ExceptionHandling': 1, # /EHsc
87 'SuppressStartupBanner': 'true',
88 'WarnAsError': 'false',
89 'AdditionalOptions': [
90 '/MP', # compile across multiple CPUs
94 'GenerateDebugInformation': 'true',
95 'RandomizedBaseAddress': 2, # enable ASLR
96 'DataExecutionPrevention': 2, # enable DEP
97 'AllowIsolation': 'true',
98 'SuppressStartupBanner': 'true',
99 'target_conditions': [
100 ['_type=="executable"', {
101 'SubSystem': 1, # console executable
108 'ALWAYS_SEARCH_USER_PATHS': 'NO',
109 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
110 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
111 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
112 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
113 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
114 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
115 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
116 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
117 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
118 'PREBINDING': 'NO', # No -Wl,-prebind
119 'USE_HEADERMAP': 'NO',
124 '-Wno-unused-parameter'
130 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
133 # we don't want VC++ warning us about how dangerous C functions are.
134 '_CRT_SECURE_NO_DEPRECATE',
135 # ... or that C implementations shouldn't use POSIX names
136 '_CRT_NONSTDC_NO_DEPRECATE'
140 [ 'OS in "linux freebsd openbsd solaris android aix"', {
142 'gcc_version%': '<!(python build/gcc_version.py)>)'
144 'cflags': [ '-Wall' ],
145 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
147 [ 'host_arch != target_arch and target_arch=="ia32"', {
148 'cflags': [ '-m32' ],
149 'ldflags': [ '-m32' ]
152 'cflags': [ '-ansi' ]
154 [ 'visibility=="hidden" and gcc_version >= "4.0.0"', {
155 'cflags': [ '-fvisibility=hidden' ]
161 'target_conditions': [
162 ['_type!="static_library"', {
163 'cflags': [ '-fPIC' ],
165 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
166 # (Equivalent to -fPIC)
167 'OTHER_LDFLAGS': [ '-Wl,-search_paths_first' ]