electron.gyp 27 KB

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