common.gypi 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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)/v8',
  133. '<(libchromiumcontent_src_dir)/v8/include',
  134. ],
  135. 'conditions': [
  136. ['OS=="mac" and libchromiumcontent_component==0', {
  137. # -all_load is the "whole-archive" on macOS.
  138. 'xcode_settings': {
  139. 'OTHER_LDFLAGS': [ '-Wl,-all_load' ],
  140. },
  141. }],
  142. ['OS=="win"', {
  143. # Fix passing fd across modules, see |osfhandle.h| for more.
  144. 'sources': [
  145. '<(DEPTH)/atom/node/osfhandle.cc',
  146. '<(DEPTH)/atom/node/osfhandle.h',
  147. ],
  148. 'include_dirs': [
  149. '<(DEPTH)/atom/node',
  150. ],
  151. 'libraries': [
  152. # Node is using networking API but linking with this itself.
  153. '-lwinmm.lib',
  154. # Needed by V8.
  155. '-ldbghelp.lib',
  156. '-lshlwapi.lib',
  157. ],
  158. # Fix the linking error with icu.
  159. 'conditions': [
  160. ['libchromiumcontent_component==0', {
  161. 'variables': {
  162. 'conditions': [
  163. ['target_arch=="ia32"', {
  164. 'reference_symbols': [
  165. '_u_errorName_56',
  166. '_ubidi_setPara_56',
  167. '_ucsdet_getName_56',
  168. '_uidna_openUTS46_56',
  169. '_ulocdata_close_56',
  170. '_unorm_normalize_56',
  171. '_uregex_matches_56',
  172. '_uscript_getCode_56',
  173. '_uspoof_open_56',
  174. '_usearch_setPattern_56',
  175. '?createInstance@Transliterator@icu_56@@SAPAV12@ABVUnicodeString@2@W4UTransDirection@@AAW4UErrorCode@@@Z',
  176. '??0MeasureFormat@icu_56@@QAE@ABVLocale@1@W4UMeasureFormatWidth@@AAW4UErrorCode@@@Z',
  177. ],
  178. }, {
  179. 'reference_symbols': [
  180. 'u_errorName_56',
  181. 'ubidi_setPara_56',
  182. 'ucsdet_getName_56',
  183. 'uidna_openUTS46_56',
  184. 'ulocdata_close_56',
  185. 'unorm_normalize_56',
  186. 'uregex_matches_56',
  187. 'uspoof_open_56',
  188. 'usearch_setPattern_56',
  189. '?createInstance@Transliterator@icu_56@@SAPEAV12@AEBVUnicodeString@2@W4UTransDirection@@AEAW4UErrorCode@@@Z',
  190. '??0MeasureFormat@icu_56@@QEAA@AEBVLocale@1@W4UMeasureFormatWidth@@AEAW4UErrorCode@@@Z',
  191. ],
  192. }],
  193. ],
  194. },
  195. 'msvs_settings': {
  196. 'VCLinkerTool': {
  197. # There is nothing like "whole-archive" on Windows, so we
  198. # have to manually force some objets files to be included
  199. # by referencing them.
  200. 'ForceSymbolReferences': [ '<@(reference_symbols)' ], # '/INCLUDE'
  201. },
  202. },
  203. }],
  204. ],
  205. }],
  206. ['OS=="linux" and libchromiumcontent_component==0', {
  207. # Prevent the linker from stripping symbols.
  208. 'ldflags': [
  209. '-Wl,--whole-archive',
  210. '<@(libchromiumcontent_v8_libraries)',
  211. '-Wl,--no-whole-archive',
  212. ],
  213. }, {
  214. 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
  215. }],
  216. ],
  217. }],
  218. ['_target_name=="openssl"', {
  219. 'xcode_settings': {
  220. 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
  221. 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
  222. 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',
  223. },
  224. 'cflags': [
  225. '-fvisibility=hidden',
  226. ],
  227. }],
  228. ['_target_name=="libuv"', {
  229. 'conditions': [
  230. ['OS=="win"', {
  231. # Expose libuv's symbols.
  232. 'defines': [
  233. 'BUILDING_UV_SHARED=1',
  234. ],
  235. }], # OS=="win"
  236. ],
  237. }],
  238. ['_target_name.startswith("crashpad")', {
  239. 'conditions': [
  240. ['OS=="mac"', {
  241. 'xcode_settings': {
  242. 'WARNING_CFLAGS': [
  243. '-Wno-unused-private-field',
  244. '-Wno-address-of-packed-member',
  245. ],
  246. },
  247. }], # OS=="mac"
  248. ],
  249. }],
  250. ['_target_name.startswith("breakpad") or _target_name in ["crash_report_sender", "dump_syms"]', {
  251. 'conditions': [
  252. ['OS=="mac"', {
  253. 'xcode_settings': {
  254. 'WARNING_CFLAGS': [
  255. '-Wno-deprecated-declarations',
  256. '-Wno-deprecated-register',
  257. '-Wno-unused-private-field',
  258. '-Wno-unused-function',
  259. ],
  260. },
  261. }], # OS=="mac"
  262. ['OS=="linux"', {
  263. 'cflags': [
  264. '-Wno-empty-body',
  265. ],
  266. }], # OS=="linux"
  267. ['OS=="win"', {
  268. 'msvs_disabled_warnings': [
  269. # unreferenced local function has been removed.
  270. 4505,
  271. ],
  272. }], # OS=="win"
  273. ],
  274. }],
  275. ],
  276. 'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
  277. 'msvs_disabled_warnings': [
  278. 4005, # (node.h) macro redefinition
  279. 4091, # (node_extern.h) '__declspec(dllimport)' : ignored on left of 'node::Environment' when no variable is declared
  280. 4189, # local variable is initialized but not referenced
  281. 4201, # (uv.h) nameless struct/union
  282. 4267, # conversion from 'size_t' to 'int', possible loss of data
  283. 4302, # (atldlgs.h) 'type cast': truncation from 'LPCTSTR' to 'WORD'
  284. 4458, # (atldlgs.h) declaration of 'dwCommonButtons' hides class member
  285. 4503, # decorated name length exceeded, name was truncated
  286. 4800, # (v8.h) forcing value to bool 'true' or 'false'
  287. 4819, # The file contains a character that cannot be represented in the current code page
  288. 4838, # (atlgdi.h) conversion from 'int' to 'UINT' requires a narrowing conversion
  289. 4996, # (atlapp.h) 'GetVersionExW': was declared deprecated
  290. ],
  291. },
  292. 'conditions': [
  293. # The breakdpad on Windows assumes Debug_x64 and Release_x64 configurations.
  294. ['OS=="win"', {
  295. 'target_defaults': {
  296. 'configurations': {
  297. 'Debug_x64': {
  298. },
  299. 'Release_x64': {
  300. },
  301. },
  302. },
  303. }], # OS=="win"
  304. # The breakdpad on Mac assumes Release_Base configuration.
  305. ['OS=="mac"', {
  306. 'target_defaults': {
  307. 'configurations': {
  308. 'Release_Base': {
  309. },
  310. },
  311. },
  312. }], # OS=="mac"
  313. ],
  314. }