common.gypi 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. {
  2. 'includes': [
  3. 'toolchain.gypi',
  4. 'brightray/brightray.gypi',
  5. ],
  6. 'variables': {
  7. # Tell crashpad to build as external project.
  8. 'crashpad_dependencies': 'external',
  9. # Required by breakpad.
  10. 'os_bsd': 0,
  11. 'chromeos': 0,
  12. # Reflects node's config.gypi.
  13. 'component%': 'static_library',
  14. 'debug_http2': 'false',
  15. 'debug_nghttp2': 'false',
  16. 'python': 'python',
  17. 'openssl_fips': '',
  18. 'openssl_no_asm': 1,
  19. 'use_openssl_def': 0,
  20. 'OPENSSL_PRODUCT': 'libopenssl.a',
  21. 'node_release_urlbase': 'https://atom.io/download/electron',
  22. 'node_byteorder': '<!(node <(DEPTH)/tools/get-endianness.js)',
  23. 'node_target_type': 'shared_library',
  24. 'node_install_npm': 'false',
  25. 'node_prefix': '',
  26. 'node_shared': 'true',
  27. 'node_shared_cares': 'false',
  28. 'node_shared_http_parser': 'false',
  29. 'node_shared_libuv': 'false',
  30. 'node_shared_openssl': 'false',
  31. 'node_shared_v8': 'true',
  32. 'node_shared_zlib': 'false',
  33. 'node_tag': '',
  34. 'node_use_dtrace': 'false',
  35. 'node_use_etw': 'false',
  36. 'node_use_mdb': 'false',
  37. 'node_use_openssl': 'true',
  38. 'node_use_perfctr': 'false',
  39. 'node_use_v8_platform': 'false',
  40. 'node_use_bundled_v8': 'false',
  41. 'node_enable_d8': 'false',
  42. 'uv_library': 'static_library',
  43. 'uv_parent_path': 'vendor/node/deps/uv',
  44. 'uv_use_dtrace': 'false',
  45. 'V8_BASE': '',
  46. 'v8_postmortem_support': 'false',
  47. 'v8_enable_i18n_support': 'false',
  48. 'v8_enable_inspector': '1',
  49. },
  50. # Settings to compile node under Windows.
  51. 'target_defaults': {
  52. 'target_conditions': [
  53. ['_target_name in ["libuv", "http_parser", "openssl", "openssl-cli", "cares", "node", "zlib", "nghttp2"]', {
  54. 'msvs_disabled_warnings': [
  55. 4003, # not enough actual parameters for macro 'V'
  56. 4013, # 'free' undefined; assuming extern returning int
  57. 4018, # signed/unsigned mismatch
  58. 4054, #
  59. 4055, # 'type cast' : from data pointer 'void *' to function pointer
  60. 4057, # 'function' : 'volatile LONG *' differs in indirection to slightly different base types from 'unsigned long *'
  61. 4065, # switch statement contains 'default' but no 'case' labels
  62. 4189, #
  63. 4131, # uses old-style declarator
  64. 4133, # incompatible types
  65. 4146, # unary minus operator applied to unsigned type, result still unsigned
  66. 4164, # intrinsic function not declared
  67. 4152, # function/data pointer conversion in expression
  68. 4206, # translation unit is empty
  69. 4204, # non-constant aggregate initializer
  70. 4210, # nonstandard extension used : function given file scope
  71. 4214, # bit field types other than int
  72. 4232, # address of dllimport 'free' is not static, identity not guaranteed
  73. 4291, # no matching operator delete found
  74. 4295, # array is too small to include a terminating null character
  75. 4311, # 'type cast': pointer truncation from 'void *const ' to 'unsigned long'
  76. 4389, # '==' : signed/unsigned mismatch
  77. 4456, # declaration of 'm' hides previous local declaration
  78. 4457, # declaration of 'message' hides function parameter
  79. 4459, # declaration of 'wq' hides global declaration
  80. 4477, # format string '%.*s' requires an argument of type 'int'
  81. 4505, # unreferenced local function has been removed
  82. 4701, # potentially uninitialized local variable 'sizew' used
  83. 4703, # potentially uninitialized local pointer variable 'req' used
  84. 4706, # assignment within conditional expression
  85. 4804, # unsafe use of type 'bool' in operation
  86. 4996, # this function or variable may be unsafe.
  87. ],
  88. 'msvs_settings': {
  89. 'VCCLCompilerTool': {
  90. 'WarnAsError': 'false',
  91. },
  92. },
  93. 'xcode_settings': {
  94. 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
  95. 'WARNING_CFLAGS': [
  96. '-Wno-unknown-warning-option',
  97. '-Wno-parentheses-equality',
  98. '-Wno-unused-function',
  99. '-Wno-sometimes-uninitialized',
  100. '-Wno-pointer-sign',
  101. '-Wno-sign-compare',
  102. '-Wno-string-plus-int',
  103. '-Wno-unused-variable',
  104. '-Wno-deprecated-declarations',
  105. '-Wno-return-type',
  106. '-Wno-gnu-folding-constant',
  107. '-Wno-shift-negative-value',
  108. '-Wno-varargs', # https://git.io/v6Olj
  109. ],
  110. },
  111. 'conditions': [
  112. ['OS=="linux"', {
  113. 'cflags': [
  114. '-Wno-unused-function',
  115. '-Wno-unused-variable',
  116. '-Wno-unused-value',
  117. '-Wno-deprecated-declarations',
  118. '-Wno-return-type',
  119. '-Wno-format',
  120. '-Wno-varargs', # https://git.io/v6Olj
  121. # Required when building as shared library.
  122. '-fPIC',
  123. ],
  124. }],
  125. ['OS=="linux" and clang==1', {
  126. 'cflags': [
  127. '-Wno-pointer-sign',
  128. '-Wno-parentheses-equality',
  129. '-Wno-sometimes-uninitialized',
  130. '-Wno-string-plus-int',
  131. '-Wno-shift-negative-value',
  132. '-Wno-reserved-user-defined-literal',
  133. ],
  134. }],
  135. ],
  136. }],
  137. ['_target_name=="node"', {
  138. 'include_dirs': [
  139. '<(libchromiumcontent_src_dir)',
  140. '<(libchromiumcontent_src_dir)/third_party/icu/source/common',
  141. '<(libchromiumcontent_src_dir)/third_party/icu/source/i18n',
  142. '<(libchromiumcontent_src_dir)/v8',
  143. '<(libchromiumcontent_src_dir)/v8/include',
  144. ],
  145. 'defines': [
  146. # Export V8 symbols from node.dll / libnode.so
  147. 'BUILDING_V8_SHARED',
  148. 'BUILDING_V8_PLATFORM_SHARED',
  149. 'BUILDING_V8_BASE_SHARED',
  150. 'NODE_WITHOUT_NODE_OPTIONS',
  151. ],
  152. 'conditions': [
  153. ['OS=="mac" and libchromiumcontent_component==0', {
  154. # -all_load is the "whole-archive" on macOS.
  155. 'xcode_settings': {
  156. 'OTHER_LDFLAGS': [ '-Wl,-all_load' ],
  157. },
  158. }],
  159. ['OS=="win"', {
  160. # Fix passing fd across modules, see |osfhandle.h| for more.
  161. 'sources': [
  162. '<(DEPTH)/atom/node/osfhandle.cc',
  163. '<(DEPTH)/atom/node/osfhandle.h',
  164. ],
  165. 'include_dirs': [
  166. '<(DEPTH)/atom/node',
  167. ],
  168. 'libraries': [
  169. # Node is using networking API but linking with this itself.
  170. '-lwinmm.lib',
  171. # Needed by V8.
  172. '-ldbghelp.lib',
  173. '-lshlwapi.lib',
  174. ],
  175. }],
  176. ['OS=="linux" and libchromiumcontent_component==0', {
  177. # Prevent the linker from stripping symbols.
  178. 'ldflags': [
  179. '-Wl,--whole-archive',
  180. '<@(libchromiumcontent_v8_libraries)',
  181. '-Wl,--no-whole-archive',
  182. ],
  183. }, {
  184. 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
  185. }],
  186. ],
  187. }],
  188. ['_target_name=="openssl"', {
  189. 'xcode_settings': {
  190. 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
  191. 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
  192. 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',
  193. },
  194. 'cflags': [
  195. '-fvisibility=hidden',
  196. ],
  197. }],
  198. ['_target_name=="libuv"', {
  199. 'conditions': [
  200. ['OS=="win"', {
  201. # Expose libuv's symbols.
  202. 'defines': [
  203. 'BUILDING_UV_SHARED=1',
  204. ],
  205. }], # OS=="win"
  206. ],
  207. }],
  208. ['_target_name.startswith("crashpad")', {
  209. 'conditions': [
  210. ['OS=="mac"', {
  211. 'xcode_settings': {
  212. 'WARNING_CFLAGS': [
  213. '-Wno-unused-private-field',
  214. '-Wno-address-of-packed-member',
  215. ],
  216. },
  217. }], # OS=="mac"
  218. ],
  219. }],
  220. ['_target_name.startswith("breakpad") or _target_name in ["crash_report_sender", "dump_syms"]', {
  221. 'conditions': [
  222. ['OS=="mac"', {
  223. 'xcode_settings': {
  224. 'WARNING_CFLAGS': [
  225. '-Wno-deprecated-declarations',
  226. '-Wno-deprecated-register',
  227. '-Wno-unused-private-field',
  228. '-Wno-unused-function',
  229. ],
  230. },
  231. }], # OS=="mac"
  232. ['OS=="linux"', {
  233. 'cflags': [
  234. '-Wno-empty-body',
  235. ],
  236. }], # OS=="linux"
  237. ['OS=="win"', {
  238. 'msvs_disabled_warnings': [
  239. # unreferenced local function has been removed.
  240. 4505,
  241. ],
  242. }], # OS=="win"
  243. ],
  244. }],
  245. ],
  246. 'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
  247. 'msvs_disabled_warnings': [
  248. 4005, # (node.h) macro redefinition
  249. 4091, # (node_extern.h) '__declspec(dllimport)' : ignored on left of 'node::Environment' when no variable is declared
  250. 4099, # (pdf_render_settings.h) type name first seen using 'class' now seen using 'struct'
  251. 4189, # local variable is initialized but not referenced
  252. 4201, # (uv.h) nameless struct/union
  253. 4267, # conversion from 'size_t' to 'int', possible loss of data
  254. 4302, # (atldlgs.h) 'type cast': truncation from 'LPCTSTR' to 'WORD'
  255. 4458, # (atldlgs.h) declaration of 'dwCommonButtons' hides class member
  256. 4503, # decorated name length exceeded, name was truncated
  257. 4530, # C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
  258. 4577, # 'noexcept' used with no exception handling mode specified
  259. 4714, # (atomicstring.h) function marked as __forceinline not inlined
  260. 4800, # (v8.h) forcing value to bool 'true' or 'false'
  261. 4819, # The file contains a character that cannot be represented in the current code page
  262. 4838, # (atlgdi.h) conversion from 'int' to 'UINT' requires a narrowing conversion
  263. 4996, # (atlapp.h) 'GetVersionExW': was declared deprecated
  264. ],
  265. },
  266. 'conditions': [
  267. # The breakdpad on Windows assumes Debug_x64 and Release_x64 configurations.
  268. ['OS=="win"', {
  269. 'target_defaults': {
  270. 'configurations': {
  271. 'Debug_x64': {
  272. },
  273. 'Release_x64': {
  274. },
  275. },
  276. },
  277. }], # OS=="win"
  278. # The breakdpad on Mac assumes Release_Base configuration.
  279. ['OS=="mac"', {
  280. 'target_defaults': {
  281. 'configurations': {
  282. 'Release_Base': {
  283. },
  284. },
  285. },
  286. }], # OS=="mac"
  287. ],
  288. }