electron.gyp 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. {
  2. 'variables': {
  3. 'project_name%': 'electron',
  4. 'product_name%': 'Electron',
  5. 'company_name%': 'GitHub, Inc',
  6. 'company_abbr%': 'github',
  7. 'version%': '3.0.16',
  8. 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
  9. },
  10. 'includes': [
  11. 'features.gypi',
  12. 'filenames.gypi',
  13. 'native_mate/native_mate_files.gypi',
  14. ],
  15. 'target_defaults': {
  16. 'defines': [
  17. 'ATOM_PRODUCT_NAME="<(product_name)"',
  18. 'ATOM_PROJECT_NAME="<(project_name)"',
  19. ],
  20. 'conditions': [
  21. ['OS=="mac"', {
  22. 'mac_framework_dirs': [
  23. '<(source_root)/external_binaries',
  24. ],
  25. }],
  26. ['enable_desktop_capturer==1', {
  27. 'defines': [
  28. 'ENABLE_DESKTOP_CAPTURER',
  29. ],
  30. }], # enable_desktop_capturer==1
  31. ['enable_osr==1', {
  32. 'defines': [
  33. 'ENABLE_OSR',
  34. ],
  35. }], # enable_osr==1
  36. ['enable_pdf_viewer==1', {
  37. 'defines': [
  38. 'ENABLE_PDF_VIEWER',
  39. ],
  40. }], # enable_pdf_viewer
  41. ['enable_run_as_node==1', {
  42. 'defines': [
  43. 'ENABLE_RUN_AS_NODE',
  44. ],
  45. }], # enable_run_as_node
  46. ['enable_view_api==1', {
  47. 'defines': [
  48. 'ENABLE_VIEW_API',
  49. ],
  50. }], # enable_view_api
  51. ],
  52. },
  53. 'targets': [
  54. {
  55. 'target_name': '<(project_name)',
  56. 'type': 'executable',
  57. 'dependencies': [
  58. 'js2asar',
  59. 'app2asar',
  60. '<(project_name)_lib',
  61. ],
  62. 'sources': [
  63. '<@(app_sources)',
  64. ],
  65. 'include_dirs': [
  66. '.',
  67. ],
  68. 'conditions': [
  69. ['OS=="mac"', {
  70. 'product_name': '<(product_name)',
  71. 'mac_bundle': 1,
  72. 'dependencies!': [
  73. '<(project_name)_lib',
  74. ],
  75. 'dependencies': [
  76. '<(project_name)_framework',
  77. '<(project_name)_helper',
  78. ],
  79. 'xcode_settings': {
  80. 'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name)',
  81. 'INFOPLIST_FILE': 'atom/browser/resources/mac/Info.plist',
  82. 'LD_RUNPATH_SEARCH_PATHS': [
  83. '@executable_path/../Frameworks',
  84. ],
  85. },
  86. 'mac_bundle_resources': [
  87. '<@(bundle_sources)',
  88. ],
  89. 'copies': [
  90. {
  91. 'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Frameworks',
  92. 'files': [
  93. '<(PRODUCT_DIR)/<(product_name) Helper.app',
  94. '<(PRODUCT_DIR)/<(product_name) Framework.framework',
  95. ],
  96. },
  97. ],
  98. 'postbuilds': [
  99. {
  100. # This postbuid step is responsible for creating the following
  101. # helpers:
  102. #
  103. # <(product_name) EH.app and <(product_name) NP.app are created
  104. # from <(product_name).app.
  105. #
  106. # The EH helper is marked for an executable heap. The NP helper
  107. # is marked for no PIE (ASLR).
  108. 'postbuild_name': 'Make More Helpers',
  109. 'action': [
  110. 'tools/mac/make_more_helpers.sh',
  111. 'Frameworks',
  112. '<(product_name)',
  113. ],
  114. },
  115. # The application doesn't have real localizations, it just has
  116. # empty .lproj directories, which is enough to convince Cocoa
  117. # that Electron supports those languages.
  118. {
  119. 'postbuild_name': 'Make Empty Localizations',
  120. 'variables': {
  121. 'apply_locales_cmd': ['python', 'tools/mac/apply_locales.py'],
  122. 'locale_dirs': [
  123. '>!@(<(apply_locales_cmd) -d ZZLOCALE.lproj <(locales))',
  124. ],
  125. },
  126. 'action': [
  127. 'tools/mac/make_locale_dirs.sh',
  128. '<@(locale_dirs)',
  129. ],
  130. },
  131. ],
  132. 'conditions': [
  133. ['mas_build==0', {
  134. 'copies': [
  135. {
  136. 'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Frameworks',
  137. 'files': [
  138. 'external_binaries/Squirrel.framework',
  139. 'external_binaries/ReactiveCocoa.framework',
  140. 'external_binaries/Mantle.framework',
  141. ],
  142. },
  143. ],
  144. }],
  145. ['mas_build==1', {
  146. 'dependencies': [
  147. '<(project_name)_login_helper',
  148. ],
  149. 'copies': [
  150. {
  151. 'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Library/LoginItems',
  152. 'files': [
  153. '<(PRODUCT_DIR)/<(product_name) Login Helper.app',
  154. ],
  155. },
  156. ],
  157. }],
  158. ],
  159. }], # OS!="mac"
  160. ['OS=="win"', {
  161. 'include_dirs': [
  162. '<(libchromiumcontent_dir)/gen/ui/resources',
  163. ],
  164. 'msvs_settings': {
  165. 'VCManifestTool': {
  166. 'EmbedManifest': 'true',
  167. 'AdditionalManifestFiles': 'atom/browser/resources/win/atom.manifest',
  168. },
  169. 'VCLinkerTool': {
  170. # Chrome builds with this minimum environment which makes e.g.
  171. # GetSystemMetrics(SM_CXSIZEFRAME) return Windows XP/2003
  172. # compatible metrics. See: https://crbug.com/361720
  173. #
  174. # The following two settings translate to a linker flag
  175. # of /SUBSYSTEM:WINDOWS,5.02
  176. 'MinimumRequiredVersion': '5.02',
  177. 'SubSystem': '2',
  178. 'AdditionalDependencies': [
  179. 'wtsapi32.lib',
  180. ],
  181. },
  182. },
  183. 'copies': [
  184. {
  185. 'variables': {
  186. 'conditions': [
  187. ['libchromiumcontent_component', {
  188. 'copied_libraries': [
  189. '<@(libchromiumcontent_shared_libraries)',
  190. '<@(libchromiumcontent_shared_v8_libraries)',
  191. ],
  192. }, {
  193. 'copied_libraries': [
  194. '<(libchromiumcontent_dir)/ffmpeg.dll',
  195. ],
  196. }],
  197. ],
  198. },
  199. 'destination': '<(PRODUCT_DIR)',
  200. 'files': [
  201. '<@(copied_libraries)',
  202. '<(libchromiumcontent_dir)/locales',
  203. '<(libchromiumcontent_dir)/libEGL.dll',
  204. '<(libchromiumcontent_dir)/libGLESv2.dll',
  205. '<(libchromiumcontent_dir)/icudtl.dat',
  206. '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak',
  207. '<(libchromiumcontent_dir)/content_resources_200_percent.pak',
  208. '<(libchromiumcontent_dir)/content_shell.pak',
  209. '<(libchromiumcontent_dir)/ui_resources_200_percent.pak',
  210. '<(libchromiumcontent_dir)/views_resources_200_percent.pak',
  211. '<(libchromiumcontent_dir)/natives_blob.bin',
  212. '<(libchromiumcontent_dir)/v8_context_snapshot.bin',
  213. 'external_binaries/d3dcompiler_47.dll',
  214. ],
  215. },
  216. ],
  217. }, {
  218. 'dependencies': [
  219. 'vendor/breakpad/breakpad.gyp:dump_syms#host',
  220. ],
  221. }], # OS=="win"
  222. ['OS=="linux"', {
  223. 'copies': [
  224. {
  225. 'variables': {
  226. 'conditions': [
  227. ['libchromiumcontent_component', {
  228. 'copied_libraries': [
  229. '<(PRODUCT_DIR)/lib/libnode.so',
  230. '<@(libchromiumcontent_shared_libraries)',
  231. '<@(libchromiumcontent_shared_v8_libraries)',
  232. ],
  233. }, {
  234. 'copied_libraries': [
  235. '<(PRODUCT_DIR)/lib/libnode.so',
  236. '<(libchromiumcontent_dir)/libffmpeg.so',
  237. ],
  238. }],
  239. ],
  240. },
  241. 'destination': '<(PRODUCT_DIR)',
  242. 'files': [
  243. '<@(copied_libraries)',
  244. '<(libchromiumcontent_dir)/locales',
  245. '<(libchromiumcontent_dir)/icudtl.dat',
  246. '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak',
  247. '<(libchromiumcontent_dir)/content_resources_200_percent.pak',
  248. '<(libchromiumcontent_dir)/content_shell.pak',
  249. '<(libchromiumcontent_dir)/ui_resources_200_percent.pak',
  250. '<(libchromiumcontent_dir)/views_resources_200_percent.pak',
  251. '<(libchromiumcontent_dir)/natives_blob.bin',
  252. '<(libchromiumcontent_dir)/v8_context_snapshot.bin',
  253. ],
  254. },
  255. ],
  256. }], # OS=="linux"
  257. ],
  258. }, # target <(project_name)
  259. {
  260. 'target_name': '<(project_name)_lib',
  261. 'type': 'static_library',
  262. 'dependencies': [
  263. 'atom_js2c',
  264. 'brightray/brightray.gyp:brightray',
  265. 'vendor/node/node.gyp:node_lib',
  266. ],
  267. 'defines': [
  268. # We need to access internal implementations of Node.
  269. 'NODE_WANT_INTERNALS=1',
  270. 'NODE_SHARED_MODE',
  271. 'HAVE_OPENSSL=1',
  272. 'HAVE_INSPECTOR=1',
  273. # This is defined in skia/skia_common.gypi.
  274. 'SK_SUPPORT_LEGACY_GETTOPDEVICE',
  275. # Disable warnings for g_settings_list_schemas.
  276. 'GLIB_DISABLE_DEPRECATION_WARNINGS',
  277. # Defined in Chromium but not exposed in its gyp file.
  278. 'V8_USE_EXTERNAL_STARTUP_DATA',
  279. # Import V8 symbols from shared library (node.dll / libnode.so)
  280. 'USING_V8_SHARED',
  281. 'USING_V8_PLATFORM_SHARED',
  282. 'USING_V8_BASE_SHARED',
  283. # See Chromium src/third_party/protobuf/BUILD.gn
  284. 'GOOGLE_PROTOBUF_NO_RTTI',
  285. 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER',
  286. # Enables SkBitmap size 64 operations
  287. 'SK_SUPPORT_LEGACY_SAFESIZE64',
  288. # Enables flash support
  289. 'ENABLE_PEPPER_FLASH',
  290. # Enables widevine cdm support
  291. 'WIDEVINE_CDM_AVAILABLE',
  292. ],
  293. 'sources': [
  294. '<@(lib_sources)',
  295. ],
  296. 'include_dirs': [
  297. '.',
  298. 'chromium_src',
  299. 'native_mate',
  300. # Include atom_natives.h.
  301. '<(SHARED_INTERMEDIATE_DIR)',
  302. # Include directories for uv and node.
  303. 'vendor/node/src',
  304. 'vendor/node/deps/http_parser',
  305. 'vendor/node/deps/uv/include',
  306. # The `node.h` is using `#include"v8.h"`.
  307. '<(libchromiumcontent_src_dir)/v8/include',
  308. # The `node.h` is using `#include"ares.h"`.
  309. 'vendor/node/deps/cares/include',
  310. # The `third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h` is using `platform/PlatformExport.h`.
  311. '<(libchromiumcontent_src_dir)/third_party/WebKit/Source',
  312. # The 'third_party/libyuv/include/libyuv/scale_argb.h' is using 'libyuv/basic_types.h'.
  313. '<(libchromiumcontent_src_dir)/third_party/libyuv/include',
  314. # The 'third_party/webrtc/modules/desktop_capture/desktop_frame.h' is using 'webrtc/base/scoped_ptr.h'.
  315. '<(libchromiumcontent_src_dir)/third_party/',
  316. '<(libchromiumcontent_src_dir)/components/cdm',
  317. '<(libchromiumcontent_src_dir)/third_party/widevine',
  318. '<(libchromiumcontent_src_dir)/third_party/widevine/cdm/stub',
  319. '<(libchromiumcontent_src_dir)/third_party/protobuf/src',
  320. # The 'third_party/webrtc/modules/desktop_capture/desktop_capture_options.h' is using 'rtc_base/constructormagic.h'.
  321. '<(libchromiumcontent_src_dir)/third_party/webrtc',
  322. # leveldb includes are required
  323. '<(libchromiumcontent_src_dir)/third_party/leveldatabase/src',
  324. '<(libchromiumcontent_src_dir)/third_party/leveldatabase/src/include',
  325. ],
  326. 'direct_dependent_settings': {
  327. 'include_dirs': [
  328. '.',
  329. ],
  330. },
  331. 'export_dependent_settings': [
  332. 'brightray/brightray.gyp:brightray',
  333. ],
  334. 'conditions': [
  335. ['enable_pdf_viewer==1', {
  336. 'dependencies': [
  337. 'vendor/pdf_viewer/pdf_viewer.gyp:pdf_viewer',
  338. ],
  339. }], # enable_pdf_viewer
  340. ['libchromiumcontent_component', {
  341. 'link_settings': {
  342. 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
  343. },
  344. 'sources': [
  345. '<@(lib_sources_location_provider)',
  346. ],
  347. 'defines': [
  348. # Enable fake location provider to mock geolocation
  349. # responses in component build. Should not be enabled
  350. # for release build. If you need to test with chromium's
  351. # location provider, remove this definition.
  352. 'OVERRIDE_LOCATION_PROVIDER',
  353. ],
  354. }],
  355. ['OS=="win"', {
  356. 'sources': [
  357. '<@(lib_sources_win)',
  358. ],
  359. 'link_settings': {
  360. 'libraries': [
  361. '-limm32.lib',
  362. '-loleacc.lib',
  363. '-lcomctl32.lib',
  364. '-lcomdlg32.lib',
  365. '-lwininet.lib',
  366. '-lwinmm.lib',
  367. '-lcrypt32.lib',
  368. '-luiautomationcore.lib',
  369. '-lPropsys.lib'
  370. ],
  371. },
  372. 'dependencies': [
  373. # Node is built as static_library on Windows, so we also need to
  374. # include its dependencies here.
  375. 'vendor/node/deps/cares/cares.gyp:cares',
  376. 'vendor/node/deps/http_parser/http_parser.gyp:http_parser',
  377. 'vendor/node/deps/uv/uv.gyp:libuv',
  378. 'vendor/node/deps/zlib/zlib.gyp:zlib',
  379. # Build with breakpad support.
  380. 'vendor/breakpad/breakpad.gyp:breakpad_handler',
  381. 'vendor/breakpad/breakpad.gyp:breakpad_sender',
  382. ],
  383. }], # OS=="win"
  384. ['OS=="mac" and mas_build==0', {
  385. 'dependencies': [
  386. 'vendor/crashpad/client/client.gyp:crashpad_client',
  387. 'vendor/crashpad/handler/handler.gyp:crashpad_handler',
  388. ],
  389. 'link_settings': {
  390. # Do not link with QTKit for mas build.
  391. 'libraries': [
  392. '$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
  393. ],
  394. },
  395. 'xcode_settings': {
  396. # ReactiveCocoa which is used by Squirrel requires using __weak.
  397. 'CLANG_ENABLE_OBJC_WEAK': 'YES',
  398. 'OTHER_CFLAGS': [
  399. '-Wunguarded-availability',
  400. '-Wobjc-missing-property-synthesis',
  401. ],
  402. },
  403. }], # OS=="mac" and mas_build==0
  404. ['OS=="mac" and mas_build==1', {
  405. 'defines': [
  406. 'MAS_BUILD',
  407. ],
  408. 'sources!': [
  409. 'atom/browser/auto_updater_mac.mm',
  410. 'atom/common/crash_reporter/crash_reporter_mac.h',
  411. 'atom/common/crash_reporter/crash_reporter_mac.mm',
  412. ],
  413. 'dependencies': [
  414. # Somehow we have code from Chromium using crashpad, very likely
  415. # from components/crash.
  416. # Since we do not actually invoke code from components/crash, this
  417. # dependency should be eventually optimized out by linker.
  418. 'vendor/crashpad/client/client.gyp:crashpad_client',
  419. ],
  420. }], # OS=="mac" and mas_build==1
  421. ['OS=="linux"', {
  422. 'sources': [
  423. '<@(lib_sources_linux)',
  424. '<@(lib_sources_nss)',
  425. ],
  426. 'link_settings': {
  427. 'ldflags': [
  428. # Make binary search for libraries under current directory, so we
  429. # don't have to manually set $LD_LIBRARY_PATH:
  430. # http://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable
  431. '-Wl,-rpath=\$$ORIGIN',
  432. # Make native module dynamic loading work.
  433. '-rdynamic',
  434. ],
  435. },
  436. # Required settings of using breakpad.
  437. 'cflags_cc': [
  438. '-Wno-empty-body',
  439. ],
  440. 'include_dirs': [
  441. 'vendor/breakpad/src',
  442. ],
  443. 'dependencies': [
  444. 'vendor/breakpad/breakpad.gyp:breakpad_client',
  445. ],
  446. }], # OS=="linux"
  447. ['OS=="linux" and clang==1', {
  448. # Required settings of using breakpad.
  449. 'cflags_cc': [
  450. '-Wno-reserved-user-defined-literal',
  451. ],
  452. }], # OS=="linux" and clang==1
  453. ],
  454. }, # target <(product_name)_lib
  455. {
  456. 'target_name': 'js2asar',
  457. 'type': 'none',
  458. 'actions': [
  459. {
  460. 'action_name': 'js2asar',
  461. 'variables': {
  462. 'conditions': [
  463. ['OS=="mac"', {
  464. 'resources_path': '<(PRODUCT_DIR)/<(product_name).app/Contents/Resources',
  465. },{
  466. 'resources_path': '<(PRODUCT_DIR)/resources',
  467. }],
  468. ],
  469. },
  470. 'inputs': [
  471. '<@(js_sources)',
  472. ],
  473. 'outputs': [
  474. '<(resources_path)/electron.asar',
  475. ],
  476. 'action': [
  477. 'python',
  478. 'tools/js2asar.py',
  479. '<@(_outputs)',
  480. 'lib',
  481. '<@(_inputs)',
  482. ],
  483. }
  484. ],
  485. }, # target js2asar
  486. {
  487. 'target_name': 'app2asar',
  488. 'type': 'none',
  489. 'actions': [
  490. {
  491. 'action_name': 'app2asar',
  492. 'variables': {
  493. 'conditions': [
  494. ['OS=="mac"', {
  495. 'resources_path': '<(PRODUCT_DIR)/<(product_name).app/Contents/Resources',
  496. },{
  497. 'resources_path': '<(PRODUCT_DIR)/resources',
  498. }],
  499. ],
  500. },
  501. 'inputs': [
  502. '<@(default_app_sources)',
  503. ],
  504. 'outputs': [
  505. '<(resources_path)/default_app.asar',
  506. ],
  507. 'action': [
  508. 'python',
  509. 'tools/js2asar.py',
  510. '<@(_outputs)',
  511. 'default_app',
  512. '<@(_inputs)',
  513. ],
  514. }
  515. ],
  516. }, # target app2asar
  517. {
  518. 'target_name': 'atom_js2c_copy',
  519. 'type': 'none',
  520. 'copies': [
  521. {
  522. 'destination': '<(js2c_input_dir)',
  523. 'files': [
  524. '<@(js2c_sources)',
  525. ],
  526. },
  527. ],
  528. }, # target atom_js2c_copy
  529. {
  530. 'target_name': 'atom_browserify',
  531. 'type': 'none',
  532. 'dependencies': [
  533. # depend on this target to ensure the '<(js2c_input_dir)' is created
  534. 'atom_js2c_copy',
  535. ],
  536. 'variables': {
  537. 'sandbox_args': [
  538. './lib/sandboxed_renderer/init.js',
  539. '-r',
  540. './lib/sandboxed_renderer/api/exports/electron.js:electron',
  541. '-r',
  542. './lib/sandboxed_renderer/api/exports/fs.js:fs',
  543. '-r',
  544. './lib/sandboxed_renderer/api/exports/os.js:os',
  545. '-r',
  546. './lib/sandboxed_renderer/api/exports/path.js:path',
  547. '-r',
  548. './lib/sandboxed_renderer/api/exports/child_process.js:child_process'
  549. ],
  550. 'isolated_args': [
  551. 'lib/isolated_renderer/init.js',
  552. ]
  553. },
  554. 'actions': [
  555. {
  556. 'action_name': 'atom_browserify_sandbox',
  557. 'inputs': [
  558. '<!@(python tools/list-browserify-deps.py <(sandbox_args))'
  559. ],
  560. 'outputs': [
  561. '<(js2c_input_dir)/preload_bundle.js',
  562. ],
  563. 'action': [
  564. 'npm',
  565. 'run',
  566. '--silent',
  567. 'browserify',
  568. '--',
  569. '<@(sandbox_args)',
  570. '-o',
  571. '<@(_outputs)',
  572. ],
  573. },
  574. {
  575. 'action_name': 'atom_browserify_isolated_context',
  576. 'inputs': [
  577. '<!@(python tools/list-browserify-deps.py <(isolated_args))'
  578. ],
  579. 'outputs': [
  580. '<(js2c_input_dir)/isolated_bundle.js',
  581. ],
  582. 'action': [
  583. 'npm',
  584. 'run',
  585. '--silent',
  586. 'browserify',
  587. '--',
  588. '<@(isolated_args)',
  589. '-o',
  590. '<@(_outputs)',
  591. ],
  592. },
  593. ],
  594. }, # target atom_browserify
  595. {
  596. 'target_name': 'atom_js2c',
  597. 'type': 'none',
  598. 'dependencies': [
  599. 'atom_js2c_copy',
  600. 'atom_browserify',
  601. ],
  602. 'actions': [
  603. {
  604. 'action_name': 'atom_js2c',
  605. 'inputs': [
  606. # List all input files that should trigger a rebuild with js2c
  607. '<@(js2c_sources)',
  608. '<(js2c_input_dir)/preload_bundle.js',
  609. '<(js2c_input_dir)/isolated_bundle.js',
  610. ],
  611. 'outputs': [
  612. '<(SHARED_INTERMEDIATE_DIR)/atom_natives.h',
  613. ],
  614. 'action': [
  615. 'python',
  616. 'tools/js2c.py',
  617. 'vendor/node',
  618. '<@(_outputs)',
  619. '<(js2c_input_dir)',
  620. ],
  621. }
  622. ],
  623. }, # target atom_js2c
  624. ],
  625. 'conditions': [
  626. ['OS=="mac"', {
  627. 'targets': [
  628. {
  629. 'target_name': '<(project_name)_framework',
  630. 'product_name': '<(product_name) Framework',
  631. 'type': 'shared_library',
  632. 'dependencies': [
  633. '<(project_name)_lib',
  634. ],
  635. 'sources': [
  636. '<@(framework_sources)',
  637. ],
  638. 'include_dirs': [
  639. '.',
  640. 'vendor',
  641. '<(libchromiumcontent_src_dir)',
  642. ],
  643. 'export_dependent_settings': [
  644. '<(project_name)_lib',
  645. ],
  646. 'link_settings': {
  647. 'libraries': [
  648. '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
  649. '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
  650. '$(SDKROOT)/System/Library/Frameworks/Quartz.framework',
  651. '$(SDKROOT)/System/Library/Frameworks/Security.framework',
  652. '$(SDKROOT)/System/Library/Frameworks/SecurityInterface.framework',
  653. '$(SDKROOT)/System/Library/Frameworks/ServiceManagement.framework',
  654. '$(SDKROOT)/System/Library/Frameworks/StoreKit.framework',
  655. ],
  656. },
  657. 'mac_bundle': 1,
  658. 'mac_bundle_resources': [
  659. 'atom/common/resources/mac/MainMenu.xib',
  660. '<(libchromiumcontent_dir)/icudtl.dat',
  661. '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak',
  662. '<(libchromiumcontent_dir)/content_resources_200_percent.pak',
  663. '<(libchromiumcontent_dir)/content_shell.pak',
  664. '<(libchromiumcontent_dir)/ui_resources_200_percent.pak',
  665. '<(libchromiumcontent_dir)/views_resources_200_percent.pak',
  666. '<(libchromiumcontent_dir)/natives_blob.bin',
  667. '<(libchromiumcontent_dir)/v8_context_snapshot.bin',
  668. ],
  669. 'xcode_settings': {
  670. 'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name).framework',
  671. 'INFOPLIST_FILE': 'atom/common/resources/mac/Info.plist',
  672. 'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name) Framework.framework/<(product_name) Framework',
  673. 'LD_RUNPATH_SEARCH_PATHS': [
  674. '@loader_path/Libraries',
  675. ],
  676. 'OTHER_LDFLAGS': [
  677. '-ObjC',
  678. ],
  679. },
  680. 'copies': [
  681. {
  682. 'variables': {
  683. 'conditions': [
  684. ['libchromiumcontent_component', {
  685. 'copied_libraries': [
  686. '<(PRODUCT_DIR)/libnode.dylib',
  687. '<@(libchromiumcontent_shared_libraries)',
  688. '<@(libchromiumcontent_shared_v8_libraries)',
  689. ],
  690. }, {
  691. 'copied_libraries': [
  692. '<(PRODUCT_DIR)/libnode.dylib',
  693. '<(libchromiumcontent_dir)/libffmpeg.dylib',
  694. ],
  695. }],
  696. ],
  697. },
  698. 'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Libraries',
  699. 'files': [
  700. '<@(copied_libraries)',
  701. ],
  702. },
  703. ],
  704. 'postbuilds': [
  705. {
  706. 'postbuild_name': 'Fix path of libnode',
  707. 'action': [
  708. 'install_name_tool',
  709. '-change',
  710. '/usr/local/lib/libnode.dylib',
  711. '@rpath/libnode.dylib',
  712. '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework',
  713. ],
  714. },
  715. {
  716. 'postbuild_name': 'Add symlinks for framework subdirectories',
  717. 'action': [
  718. 'tools/mac/create-framework-subdir-symlinks.sh',
  719. '<(product_name) Framework',
  720. 'Libraries',
  721. ],
  722. },
  723. {
  724. 'postbuild_name': 'Copy locales',
  725. 'action': [
  726. 'tools/mac/copy-locales.py',
  727. '-d',
  728. '<(libchromiumcontent_dir)/locales',
  729. '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Resources',
  730. '<@(locales)',
  731. ],
  732. },
  733. ],
  734. 'conditions': [
  735. ['enable_pdf_viewer==1', {
  736. 'mac_bundle_resources': [
  737. '<(PRODUCT_DIR)/pdf_viewer_resources.pak',
  738. ],
  739. }], # enable_pdf_viewer
  740. ['mas_build==0', {
  741. 'link_settings': {
  742. 'libraries': [
  743. 'external_binaries/Squirrel.framework',
  744. 'external_binaries/ReactiveCocoa.framework',
  745. 'external_binaries/Mantle.framework',
  746. ],
  747. },
  748. 'copies': [
  749. {
  750. 'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Resources',
  751. 'files': [
  752. '<(PRODUCT_DIR)/crashpad_handler',
  753. ],
  754. },
  755. ],
  756. }],
  757. ],
  758. }, # target framework
  759. {
  760. 'target_name': '<(project_name)_helper',
  761. 'product_name': '<(product_name) Helper',
  762. 'type': 'executable',
  763. 'dependencies': [
  764. '<(project_name)_framework',
  765. ],
  766. 'sources': [
  767. '<@(app_sources)',
  768. ],
  769. 'include_dirs': [
  770. '.',
  771. ],
  772. 'mac_bundle': 1,
  773. 'xcode_settings': {
  774. 'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name).helper',
  775. 'INFOPLIST_FILE': 'atom/renderer/resources/mac/Info.plist',
  776. 'LD_RUNPATH_SEARCH_PATHS': [
  777. '@executable_path/../../..',
  778. ],
  779. },
  780. }, # target helper
  781. {
  782. 'target_name': '<(project_name)_login_helper',
  783. 'product_name': '<(product_name) Login Helper',
  784. 'type': 'executable',
  785. 'sources': [
  786. '<@(login_helper_sources)',
  787. ],
  788. 'include_dirs': [
  789. '.',
  790. 'vendor',
  791. '<(libchromiumcontent_src_dir)',
  792. ],
  793. 'link_settings': {
  794. 'libraries': [
  795. '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
  796. ],
  797. },
  798. 'mac_bundle': 1,
  799. 'xcode_settings': {
  800. 'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name).loginhelper',
  801. 'INFOPLIST_FILE': 'atom/app/resources/mac/loginhelper-Info.plist',
  802. 'OTHER_LDFLAGS': [
  803. '-ObjC',
  804. ],
  805. },
  806. }, # target login_helper
  807. ],
  808. }], # OS!="mac"
  809. ],
  810. }