common.gypi 9.9 KB

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