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