common.gypi 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. ],
  151. 'conditions': [
  152. ['OS=="mac" and libchromiumcontent_component==0', {
  153. # -all_load is the "whole-archive" on macOS.
  154. 'xcode_settings': {
  155. 'OTHER_LDFLAGS': [ '-Wl,-all_load' ],
  156. },
  157. }],
  158. ['OS=="win"', {
  159. # Fix passing fd across modules, see |osfhandle.h| for more.
  160. 'sources': [
  161. '<(DEPTH)/atom/node/osfhandle.cc',
  162. '<(DEPTH)/atom/node/osfhandle.h',
  163. ],
  164. 'include_dirs': [
  165. '<(DEPTH)/atom/node',
  166. ],
  167. 'libraries': [
  168. # Node is using networking API but linking with this itself.
  169. '-lwinmm.lib',
  170. # Needed by V8.
  171. '-ldbghelp.lib',
  172. '-lshlwapi.lib',
  173. ],
  174. }],
  175. ['OS=="linux" and libchromiumcontent_component==0', {
  176. # Prevent the linker from stripping symbols.
  177. 'ldflags': [
  178. '-Wl,--whole-archive',
  179. '<@(libchromiumcontent_v8_libraries)',
  180. '-Wl,--no-whole-archive',
  181. ],
  182. }, {
  183. 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
  184. }],
  185. ],
  186. }],
  187. ['_target_name=="openssl"', {
  188. 'xcode_settings': {
  189. 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
  190. 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
  191. 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',
  192. },
  193. 'cflags': [
  194. '-fvisibility=hidden',
  195. ],
  196. }],
  197. ['_target_name=="libuv"', {
  198. 'conditions': [
  199. ['OS=="win"', {
  200. # Expose libuv's symbols.
  201. 'defines': [
  202. 'BUILDING_UV_SHARED=1',
  203. ],
  204. }], # OS=="win"
  205. ],
  206. }],
  207. ['_target_name.startswith("crashpad")', {
  208. 'conditions': [
  209. ['OS=="mac"', {
  210. 'xcode_settings': {
  211. 'WARNING_CFLAGS': [
  212. '-Wno-unused-private-field',
  213. '-Wno-address-of-packed-member',
  214. ],
  215. },
  216. }], # OS=="mac"
  217. ],
  218. }],
  219. ['_target_name.startswith("breakpad") or _target_name in ["crash_report_sender", "dump_syms"]', {
  220. 'conditions': [
  221. ['OS=="mac"', {
  222. 'xcode_settings': {
  223. 'WARNING_CFLAGS': [
  224. '-Wno-deprecated-declarations',
  225. '-Wno-deprecated-register',
  226. '-Wno-unused-private-field',
  227. '-Wno-unused-function',
  228. ],
  229. },
  230. }], # OS=="mac"
  231. ['OS=="linux"', {
  232. 'cflags': [
  233. '-Wno-empty-body',
  234. ],
  235. }], # OS=="linux"
  236. ['OS=="win"', {
  237. 'msvs_disabled_warnings': [
  238. # unreferenced local function has been removed.
  239. 4505,
  240. ],
  241. }], # OS=="win"
  242. ],
  243. }],
  244. ],
  245. 'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
  246. 'msvs_disabled_warnings': [
  247. 4005, # (node.h) macro redefinition
  248. 4091, # (node_extern.h) '__declspec(dllimport)' : ignored on left of 'node::Environment' when no variable is declared
  249. 4099, # (pdf_render_settings.h) type name first seen using 'class' now seen using 'struct'
  250. 4189, # local variable is initialized but not referenced
  251. 4201, # (uv.h) nameless struct/union
  252. 4267, # conversion from 'size_t' to 'int', possible loss of data
  253. 4302, # (atldlgs.h) 'type cast': truncation from 'LPCTSTR' to 'WORD'
  254. 4458, # (atldlgs.h) declaration of 'dwCommonButtons' hides class member
  255. 4503, # decorated name length exceeded, name was truncated
  256. 4530, # C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
  257. 4577, # 'noexcept' used with no exception handling mode specified
  258. 4714, # (atomicstring.h) function marked as __forceinline not inlined
  259. 4800, # (v8.h) forcing value to bool 'true' or 'false'
  260. 4819, # The file contains a character that cannot be represented in the current code page
  261. 4838, # (atlgdi.h) conversion from 'int' to 'UINT' requires a narrowing conversion
  262. 4996, # (atlapp.h) 'GetVersionExW': was declared deprecated
  263. ],
  264. },
  265. 'conditions': [
  266. # The breakdpad on Windows assumes Debug_x64 and Release_x64 configurations.
  267. ['OS=="win"', {
  268. 'target_defaults': {
  269. 'configurations': {
  270. 'Debug_x64': {
  271. },
  272. 'Release_x64': {
  273. },
  274. },
  275. },
  276. }], # OS=="win"
  277. # The breakdpad on Mac assumes Release_Base configuration.
  278. ['OS=="mac"', {
  279. 'target_defaults': {
  280. 'configurations': {
  281. 'Release_Base': {
  282. },
  283. },
  284. },
  285. }], # OS=="mac"
  286. ],
  287. }