electron.gyp 25 KB

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