common.gypi 12 KB

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