electron.gyp 26 KB

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