electron.gyp 24 KB

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