electron.gyp 23 KB

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