brightray.gyp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. {
  2. 'variables': {
  3. # The libraries brightray will be compiled to.
  4. 'linux_system_libraries': 'gtk+-3.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss',
  5. 'conditions': [
  6. ['target_arch=="mips64el"', {
  7. 'linux_system_libraries': '<(linux_system_libraries) libpulse',
  8. }],
  9. ],
  10. },
  11. 'includes': [
  12. 'filenames.gypi',
  13. ],
  14. 'targets': [
  15. {
  16. 'target_name': 'brightray',
  17. 'type': 'static_library',
  18. 'include_dirs': [
  19. '..',
  20. '<(libchromiumcontent_src_dir)',
  21. '<(libchromiumcontent_src_dir)/skia/config',
  22. '<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
  23. '<(libchromiumcontent_src_dir)/third_party/skia/include/core',
  24. '<(libchromiumcontent_src_dir)/third_party/skia/include/gpu',
  25. '<(libchromiumcontent_src_dir)/third_party/mojo/src',
  26. '<(libchromiumcontent_src_dir)/third_party/WebKit',
  27. '<(libchromiumcontent_src_dir)/third_party/khronos',
  28. '<(libchromiumcontent_dir)/gen',
  29. ],
  30. 'direct_dependent_settings': {
  31. 'include_dirs': [
  32. '../vendor',
  33. '<(libchromiumcontent_src_dir)',
  34. '<(libchromiumcontent_src_dir)/gpu',
  35. '<(libchromiumcontent_src_dir)/skia/config',
  36. '<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
  37. '<(libchromiumcontent_src_dir)/third_party/skia/include/core',
  38. '<(libchromiumcontent_src_dir)/third_party/skia/include/gpu',
  39. '<(libchromiumcontent_src_dir)/third_party/skia/include/config',
  40. '<(libchromiumcontent_src_dir)/third_party/icu/source/common',
  41. '<(libchromiumcontent_src_dir)/third_party/mojo/src',
  42. '<(libchromiumcontent_src_dir)/third_party/khronos',
  43. '<(libchromiumcontent_src_dir)/third_party/WebKit',
  44. '<(libchromiumcontent_dir)/gen',
  45. '<(libchromiumcontent_dir)/gen/third_party/WebKit',
  46. ],
  47. },
  48. 'sources': [ '<@(brightray_sources)' ],
  49. 'conditions': [
  50. # Link with libraries of libchromiumcontent.
  51. ['OS=="linux" and libchromiumcontent_component==0', {
  52. # On Linux we have to use "--whole-archive" to force executable
  53. # to include all symbols, otherwise we will have plenty of
  54. # unresolved symbols errors.
  55. 'direct_dependent_settings': {
  56. 'ldflags': [
  57. '-Wl,--whole-archive',
  58. '<@(libchromiumcontent_libraries)',
  59. '-Wl,--no-whole-archive',
  60. ],
  61. }
  62. }, { # (Release build on Linux)
  63. 'link_settings': {
  64. 'libraries': [ '<@(libchromiumcontent_libraries)' ]
  65. },
  66. }], # (Normal builds)
  67. # Linux specific link settings.
  68. ['OS=="linux"', {
  69. 'link_settings': {
  70. 'ldflags': [
  71. '<!@(<(pkg-config) --libs-only-L --libs-only-other <(linux_system_libraries))',
  72. ],
  73. 'libraries': [
  74. '-lpthread',
  75. '-latomic',
  76. '<!@(<(pkg-config) --libs-only-l <(linux_system_libraries))',
  77. ],
  78. },
  79. 'cflags': [
  80. '<!@(<(pkg-config) --cflags <(linux_system_libraries))',
  81. ],
  82. 'direct_dependent_settings': {
  83. 'cflags': [
  84. '<!@(<(pkg-config) --cflags <(linux_system_libraries))',
  85. ],
  86. },
  87. 'conditions': [
  88. ['clang==1', {
  89. 'cflags_cc': [
  90. '-Wno-reserved-user-defined-literal',
  91. ],
  92. 'cflags': [
  93. # Needed by using libgtkui:
  94. '-Wno-deprecated-register',
  95. '-Wno-sentinel',
  96. ],
  97. 'direct_dependent_settings': {
  98. 'cflags': [
  99. '-Wno-deprecated-register',
  100. '-Wno-sentinel',
  101. ],
  102. },
  103. }],
  104. ['libchromiumcontent_component', {
  105. 'link_settings': {
  106. 'libraries': [
  107. # Following libraries are always linked statically.
  108. '<(libchromiumcontent_dir)/libgtkui.a',
  109. '<(libchromiumcontent_dir)/libhttp_server.a',
  110. '<(libchromiumcontent_dir)/libdesktop_capture.a',
  111. '<(libchromiumcontent_dir)/libdom_keycode_converter.a',
  112. '<(libchromiumcontent_dir)/libsystem_wrappers.a',
  113. '<(libchromiumcontent_dir)/librtc_base.a',
  114. '<(libchromiumcontent_dir)/librtc_base_generic.a',
  115. '<(libchromiumcontent_dir)/libwebrtc_common.a',
  116. '<(libchromiumcontent_dir)/libinit_webrtc.a',
  117. '<(libchromiumcontent_dir)/libyuv.a',
  118. '<(libchromiumcontent_dir)/librenderer.a',
  119. '<(libchromiumcontent_dir)/libsecurity_state.a',
  120. # components/network_session_configurator/common/
  121. '<(libchromiumcontent_dir)/libcommon.a',
  122. # services/device/wake_lock/power_save_blocker/
  123. '<(libchromiumcontent_dir)/libpower_save_blocker.a',
  124. # Friends of libpdf.a:
  125. # On Linux we have to use "--whole-archive" to include
  126. # all symbols, otherwise there will be plenty of
  127. # unresolved symbols errors.
  128. '-Wl,--whole-archive',
  129. '<(libchromiumcontent_dir)/libpdf.a',
  130. '<(libchromiumcontent_dir)/libppapi_cpp_objects.a',
  131. '<(libchromiumcontent_dir)/libppapi_internal_module.a',
  132. '<(libchromiumcontent_dir)/libpdfium.a',
  133. '<(libchromiumcontent_dir)/libfdrm.a',
  134. '<(libchromiumcontent_dir)/libformfiller.a',
  135. '<(libchromiumcontent_dir)/libfpdfapi.a',
  136. '<(libchromiumcontent_dir)/libfpdfdoc.a',
  137. '<(libchromiumcontent_dir)/libfpdftext.a',
  138. '<(libchromiumcontent_dir)/libfxcodec.a',
  139. '<(libchromiumcontent_dir)/libfxge.a',
  140. '<(libchromiumcontent_dir)/libfxjs.a',
  141. '<(libchromiumcontent_dir)/libjavascript.a',
  142. '<(libchromiumcontent_dir)/libpwl.a',
  143. '<(libchromiumcontent_dir)/libfx_agg.a',
  144. '<(libchromiumcontent_dir)/libfx_lcms2.a',
  145. '<(libchromiumcontent_dir)/libfx_libopenjpeg.a',
  146. '<(libchromiumcontent_dir)/libfx_zlib.a',
  147. '-Wl,--no-whole-archive',
  148. ],
  149. },
  150. }, {
  151. 'link_settings': {
  152. 'libraries': [
  153. # Link with ffmpeg.
  154. '<(libchromiumcontent_dir)/libffmpeg.so',
  155. # Following libraries are required by libchromiumcontent:
  156. '-lasound',
  157. '-lcap',
  158. '-lcups',
  159. '-lrt',
  160. '-ldl',
  161. '-lresolv',
  162. '-lfontconfig',
  163. '-lexpat',
  164. ],
  165. },
  166. }],
  167. # This lib does not exist on arm.
  168. ['target_arch=="arm"', {
  169. 'link_settings': {
  170. 'libraries!': [
  171. '<(libchromiumcontent_dir)/libdesktop_capture_differ_sse2.a',
  172. ],
  173. },
  174. }],
  175. # Due to strange linker behavior, component build of arm needs to
  176. # be linked with libjpeg.a explicitly.
  177. ['target_arch=="arm" and libchromiumcontent_component==1', {
  178. 'link_settings': {
  179. 'libraries': [
  180. '<(libchromiumcontent_dir)/libjpeg.a',
  181. ],
  182. },
  183. }],
  184. ],
  185. }], # OS=="linux"
  186. ['OS=="mac"', {
  187. 'link_settings': {
  188. 'libraries': [
  189. '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
  190. # Required by webrtc:
  191. '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
  192. '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
  193. # Required by media:
  194. '$(SDKROOT)/System/Library/Frameworks/VideoToolbox.framework',
  195. ],
  196. },
  197. 'conditions': [
  198. ['libchromiumcontent_component', {
  199. 'link_settings': {
  200. 'libraries': [
  201. # Following libraries are always linked statically.
  202. '<(libchromiumcontent_dir)/libhttp_server.a',
  203. '<(libchromiumcontent_dir)/libdesktop_capture.a',
  204. '<(libchromiumcontent_dir)/libdom_keycode_converter.a',
  205. '<(libchromiumcontent_dir)/librtc_base.a',
  206. '<(libchromiumcontent_dir)/librtc_base_generic.a',
  207. '<(libchromiumcontent_dir)/libsystem_wrappers.a',
  208. '<(libchromiumcontent_dir)/libwebrtc_common.a',
  209. '<(libchromiumcontent_dir)/libinit_webrtc.a',
  210. '<(libchromiumcontent_dir)/libyuv.a',
  211. '<(libchromiumcontent_dir)/librenderer.a',
  212. '<(libchromiumcontent_dir)/libsecurity_state.a',
  213. # components/network_session_configurator/common/
  214. '<(libchromiumcontent_dir)/libcommon.a',
  215. # services/device/wake_lock/power_save_blocker/
  216. '<(libchromiumcontent_dir)/libpower_save_blocker.a',
  217. # Friends of libpdf.a:
  218. '<(libchromiumcontent_dir)/libpdf.a',
  219. '<(libchromiumcontent_dir)/libppapi_cpp_objects.a',
  220. '<(libchromiumcontent_dir)/libppapi_internal_module.a',
  221. '<(libchromiumcontent_dir)/libjpeg.a',
  222. '<(libchromiumcontent_dir)/libpdfium.a',
  223. '<(libchromiumcontent_dir)/libfdrm.a',
  224. '<(libchromiumcontent_dir)/libformfiller.a',
  225. '<(libchromiumcontent_dir)/libfpdfapi.a',
  226. '<(libchromiumcontent_dir)/libfpdfdoc.a',
  227. '<(libchromiumcontent_dir)/libfpdftext.a',
  228. '<(libchromiumcontent_dir)/libfxcodec.a',
  229. '<(libchromiumcontent_dir)/libfxcrt.a',
  230. '<(libchromiumcontent_dir)/libfxge.a',
  231. '<(libchromiumcontent_dir)/libfxjs.a',
  232. '<(libchromiumcontent_dir)/libjavascript.a',
  233. '<(libchromiumcontent_dir)/libpwl.a',
  234. '<(libchromiumcontent_dir)/libfx_agg.a',
  235. '<(libchromiumcontent_dir)/libfx_lcms2.a',
  236. '<(libchromiumcontent_dir)/libfx_libopenjpeg.a',
  237. '<(libchromiumcontent_dir)/libfx_zlib.a',
  238. ],
  239. },
  240. }, {
  241. 'link_settings': {
  242. 'libraries': [
  243. # Link with ffmpeg.
  244. '<(libchromiumcontent_dir)/libffmpeg.dylib',
  245. # Link with system frameworks.
  246. # ui_base.gypi:
  247. '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
  248. # net.gypi:
  249. '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
  250. '$(SDKROOT)/System/Library/Frameworks/Security.framework',
  251. '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
  252. '-lresolv',
  253. # media.gyp:
  254. '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
  255. '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
  256. '$(SDKROOT)/System/Library/Frameworks/AVFoundation.framework',
  257. '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
  258. '$(SDKROOT)/System/Library/Frameworks/CoreMedia.framework',
  259. '$(SDKROOT)/System/Library/Frameworks/CoreMIDI.framework',
  260. '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
  261. # surface.gyp:
  262. '$(SDKROOT)/System/Library/Frameworks/IOSurface.framework',
  263. # content_common.gypi:
  264. '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
  265. # base.gyp:
  266. '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
  267. '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
  268. '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
  269. # device/gamepad/BUILD.gn:
  270. '$(SDKROOT)/System/Library/Frameworks/GameController.framework',
  271. # content_browser.gypi:
  272. '-lbsm',
  273. # content_common.gypi:
  274. '-lsandbox',
  275. # bluetooth.gyp:
  276. '$(SDKROOT)/System/Library/Frameworks/IOBluetooth.framework',
  277. # components/wifi/BUILD.gn:
  278. '$(SDKROOT)/System/Library/Frameworks/CoreWLAN.framework',
  279. # printing/BUILD.gn:
  280. '-lcups',
  281. ],
  282. },
  283. }],
  284. ]
  285. }], # OS=="mac"
  286. ['OS=="win"', {
  287. 'link_settings': {
  288. 'msvs_settings': {
  289. 'VCLinkerTool': {
  290. 'AdditionalOptions': [
  291. # warning /DELAYLOAD:dll ignored; no imports found from dll
  292. '/ignore:4199',
  293. ],
  294. 'AdditionalDependencies': [
  295. 'delayimp.lib',
  296. ],
  297. 'DelayLoadDLLs': [
  298. 'wtsapi32.dll',
  299. # content_common.gypi:
  300. 'd3d9.dll',
  301. 'd3d11.dll',
  302. 'dxva2.dll',
  303. # media.gyp:
  304. 'mf.dll',
  305. 'mfplat.dll',
  306. 'mfreadwrite.dll',
  307. # bluetooth.gyp:
  308. 'BluetoothApis.dll',
  309. 'Bthprops.cpl',
  310. 'setupapi.dll',
  311. # base.gyp:
  312. 'cfgmgr32.dll',
  313. 'powrprof.dll',
  314. 'setupapi.dll',
  315. # net_common.gypi:
  316. 'crypt32.dll',
  317. 'dhcpcsvc.dll',
  318. 'rpcrt4.dll',
  319. 'secur32.dll',
  320. 'urlmon.dll',
  321. 'winhttp.dll',
  322. # windows runtime
  323. 'API-MS-WIN-CORE-WINRT-L1-1-0.DLL',
  324. 'API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL',
  325. ],
  326. },
  327. },
  328. },
  329. 'conditions': [
  330. ['libchromiumcontent_component', {
  331. 'link_settings': {
  332. 'libraries': [
  333. # Needed by desktop_capture.lib:
  334. '-ld3d11.lib',
  335. '-ldxgi.lib',
  336. # Following libs are always linked statically.
  337. '<(libchromiumcontent_dir)/base_static.lib',
  338. '<(libchromiumcontent_dir)/sandbox.lib',
  339. '<(libchromiumcontent_dir)/sandbox_helper_win.lib',
  340. '<(libchromiumcontent_dir)/http_server.lib',
  341. '<(libchromiumcontent_dir)/desktop_capture.lib',
  342. '<(libchromiumcontent_dir)/dom_keycode_converter.lib',
  343. '<(libchromiumcontent_dir)/rtc_base.lib',
  344. '<(libchromiumcontent_dir)/rtc_base_generic.lib',
  345. '<(libchromiumcontent_dir)/system_wrappers.lib',
  346. '<(libchromiumcontent_dir)/webrtc_common.lib',
  347. '<(libchromiumcontent_dir)/init_webrtc.lib',
  348. '<(libchromiumcontent_dir)/libyuv.lib',
  349. '<(libchromiumcontent_dir)/renderer.lib',
  350. '<(libchromiumcontent_dir)/security_state.lib',
  351. # components/network_session_configurator/common/
  352. '<(libchromiumcontent_dir)/common.lib',
  353. # services/device/wake_lock/power_save_blocker/
  354. '<(libchromiumcontent_dir)/power_save_blocker.lib',
  355. # Friends of pdf.lib:
  356. '<(libchromiumcontent_dir)/pdf.lib',
  357. '<(libchromiumcontent_dir)/ppapi_cpp_objects.lib',
  358. '<(libchromiumcontent_dir)/ppapi_internal_module.lib',
  359. '<(libchromiumcontent_dir)/libjpeg.lib',
  360. '<(libchromiumcontent_dir)/pdfium.lib',
  361. '<(libchromiumcontent_dir)/fdrm.lib',
  362. '<(libchromiumcontent_dir)/formfiller.lib',
  363. '<(libchromiumcontent_dir)/fpdfapi.lib',
  364. '<(libchromiumcontent_dir)/fpdfdoc.lib',
  365. '<(libchromiumcontent_dir)/fpdftext.lib',
  366. '<(libchromiumcontent_dir)/fpdftext.lib',
  367. '<(libchromiumcontent_dir)/fxcodec.lib',
  368. '<(libchromiumcontent_dir)/fxcrt.lib',
  369. '<(libchromiumcontent_dir)/fxge.lib',
  370. '<(libchromiumcontent_dir)/fxjs.lib',
  371. '<(libchromiumcontent_dir)/javascript.lib',
  372. '<(libchromiumcontent_dir)/pwl.lib',
  373. '<(libchromiumcontent_dir)/fx_agg.lib',
  374. '<(libchromiumcontent_dir)/fx_lcms2.lib',
  375. '<(libchromiumcontent_dir)/fx_libopenjpeg.lib',
  376. '<(libchromiumcontent_dir)/fx_zlib.lib',
  377. ],
  378. },
  379. }, {
  380. # Link with system libraries.
  381. 'link_settings': {
  382. 'libraries': [
  383. # Link with ffmpeg.
  384. '<(libchromiumcontent_dir)/ffmpeg.dll',
  385. # content_browser.gypi:
  386. '-lsensorsapi.lib',
  387. '-lportabledeviceguids.lib',
  388. # content_common.gypi:
  389. '-ld3d9.lib',
  390. '-ld3d11.lib',
  391. '-ldxgi.lib',
  392. '-ldxva2.lib',
  393. '-lstrmiids.lib',
  394. '-lmf.lib',
  395. '-lmfplat.lib',
  396. '-lmfuuid.lib',
  397. # media.gyp:
  398. '-ldxguid.lib',
  399. '-lmfreadwrite.lib',
  400. '-lmfuuid.lib',
  401. ],
  402. 'msvs_settings': {
  403. 'VCLinkerTool': {
  404. 'AdditionalDependencies': [
  405. 'advapi32.lib',
  406. 'dbghelp.lib',
  407. 'dwmapi.lib',
  408. 'gdi32.lib',
  409. 'hid.lib',
  410. 'netapi32.lib',
  411. 'oleacc.lib',
  412. 'user32.lib',
  413. 'usp10.lib',
  414. 'version.lib',
  415. 'winspool.lib',
  416. 'wtsapi32.lib',
  417. # bluetooth.gyp:
  418. 'Bthprops.lib',
  419. 'BluetoothApis.lib',
  420. # base.gyp:
  421. 'cfgmgr32.lib',
  422. 'powrprof.lib',
  423. 'setupapi.lib',
  424. # net_common.gypi:
  425. 'crypt32.lib',
  426. 'dhcpcsvc.lib',
  427. 'ncrypt.lib',
  428. 'rpcrt4.lib',
  429. 'secur32.lib',
  430. 'urlmon.lib',
  431. 'winhttp.lib',
  432. # ui/gfx/BUILD.gn:
  433. 'dwrite.lib',
  434. # skia/BUILD.gn:
  435. 'fontsub.lib',
  436. ],
  437. },
  438. },
  439. },
  440. }], # libchromiumcontent_component
  441. ],
  442. }], # OS=="win"
  443. ],
  444. },
  445. ],
  446. }