PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/common.gypi

http://github.com/joyent/libuv
Unknown | 183 lines | 182 code | 1 blank | 0 comment | 0 complexity | 5f1a2618946fa2e452e698ef3c27e6bc MD5 | raw file
  1{
  2  'variables': {
  3    'visibility%': 'hidden',         # V8's visibility setting
  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    'gcc_version%': 'unknown',
 10    'clang%': 0,
 11  },
 12
 13  'target_defaults': {
 14    'default_configuration': 'Debug',
 15    'configurations': {
 16      'Debug': {
 17        'defines': [ 'DEBUG', '_DEBUG' ],
 18        'cflags': [ '-g', '-O0', '-fwrapv' ],
 19        'msvs_settings': {
 20          'VCCLCompilerTool': {
 21            'target_conditions': [
 22              ['library=="static_library"', {
 23                'RuntimeLibrary': 1, # static debug
 24              }, {
 25                'RuntimeLibrary': 3, # DLL debug
 26              }],
 27            ],
 28            'Optimization': 0, # /Od, no optimization
 29            'MinimalRebuild': 'false',
 30            'OmitFramePointers': 'false',
 31            'BasicRuntimeChecks': 3, # /RTC1
 32          },
 33          'VCLinkerTool': {
 34            'LinkIncremental': 2, # enable incremental linking
 35          },
 36        },
 37        'xcode_settings': {
 38          'GCC_OPTIMIZATION_LEVEL': '0',
 39        },
 40        'conditions': [
 41          ['OS != "win"', {
 42            'defines': [ 'EV_VERIFY=2' ],
 43          }],
 44        ]
 45      },
 46      'Release': {
 47        'defines': [ 'NDEBUG' ],
 48        'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ],
 49        'msvs_settings': {
 50          'VCCLCompilerTool': {
 51            'target_conditions': [
 52              ['library=="static_library"', {
 53                'RuntimeLibrary': 0, # static release
 54              }, {
 55                'RuntimeLibrary': 2, # debug release
 56              }],
 57            ],
 58            'Optimization': 3, # /Ox, full optimization
 59            'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
 60            'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
 61            'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
 62            'OmitFramePointers': 'true',
 63            'EnableFunctionLevelLinking': 'true',
 64            'EnableIntrinsicFunctions': 'true',
 65          },
 66          'VCLibrarianTool': {
 67            'AdditionalOptions': [
 68              '/LTCG', # link time code generation
 69            ],
 70          },
 71          'VCLinkerTool': {
 72            'LinkTimeCodeGeneration': 1, # link-time code generation
 73            'OptimizeReferences': 2, # /OPT:REF
 74            'EnableCOMDATFolding': 2, # /OPT:ICF
 75            'LinkIncremental': 1, # disable incremental linking
 76          },
 77        },
 78      }
 79    },
 80    'msvs_settings': {
 81      'VCCLCompilerTool': {
 82        'StringPooling': 'true', # pool string literals
 83        'DebugInformationFormat': 3, # Generate a PDB
 84        'WarningLevel': 3,
 85        'BufferSecurityCheck': 'true',
 86        'ExceptionHandling': 1, # /EHsc
 87        'SuppressStartupBanner': 'true',
 88        'WarnAsError': 'false',
 89        'AdditionalOptions': [
 90           '/MP', # compile across multiple CPUs
 91         ],
 92      },
 93      'VCLibrarianTool': {
 94      },
 95      'VCLinkerTool': {
 96        'GenerateDebugInformation': 'true',
 97        'RandomizedBaseAddress': 2, # enable ASLR
 98        'DataExecutionPrevention': 2, # enable DEP
 99        'AllowIsolation': 'true',
100        'SuppressStartupBanner': 'true',
101        'target_conditions': [
102          ['_type=="executable"', {
103            'SubSystem': 1, # console executable
104          }],
105        ],
106      },
107    },
108    'conditions': [
109      ['OS == "win"', {
110        'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
111        'defines': [
112          'WIN32',
113          # we don't really want VC++ warning us about
114          # how dangerous C functions are...
115          '_CRT_SECURE_NO_DEPRECATE',
116          # ... or that C implementations shouldn't use
117          # POSIX names
118          '_CRT_NONSTDC_NO_DEPRECATE',
119        ],
120        'target_conditions': [
121          ['target_arch=="x64"', {
122            'msvs_configuration_platform': 'x64'
123          }]
124        ]
125      }],
126      [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
127        'cflags': [ '-Wall' ],
128        'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
129        'conditions': [
130          [ 'host_arch != target_arch and target_arch=="ia32"', {
131            'cflags': [ '-m32' ],
132            'ldflags': [ '-m32' ],
133          }],
134          [ 'OS=="linux"', {
135            'cflags': [ '-ansi' ],
136          }],
137          [ 'OS=="solaris"', {
138            'cflags': [ '-pthreads' ],
139            'ldflags': [ '-pthreads' ],
140          }, {
141            'cflags': [ '-pthread' ],
142            'ldflags': [ '-pthread' ],
143          }],
144          [ 'visibility=="hidden" and (clang==1 or gcc_version >= 40)', {
145            'cflags': [ '-fvisibility=hidden' ],
146          }],
147        ],
148      }],
149      ['OS=="mac"', {
150        'xcode_settings': {
151          'ALWAYS_SEARCH_USER_PATHS': 'NO',
152          'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
153          'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
154                                                    # (Equivalent to -fPIC)
155          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
156          'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
157          'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
158          # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
159          'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
160          'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
161          'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
162          'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',  # -Wnewline-eof
163          'PREBINDING': 'NO',                       # No -Wl,-prebind
164          'USE_HEADERMAP': 'NO',
165          'OTHER_CFLAGS': [
166            '-fno-strict-aliasing',
167          ],
168          'WARNING_CFLAGS': [
169            '-Wall',
170            '-Wendif-labels',
171            '-W',
172            '-Wno-unused-parameter',
173          ],
174        },
175        'target_conditions': [
176          ['_type!="static_library"', {
177            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
178          }],
179        ],
180      }],
181    ],
182  },
183}