BUILD.gn 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638
  1. # Copyright 2016 Google Inc.
  2. #
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. import("gn/flutter_defines.gni")
  6. import("gn/fuchsia_defines.gni")
  7. import("gn/shared_sources.gni")
  8. import("gn/skia.gni")
  9. if (is_fuchsia) {
  10. import("//build/fuchsia/sdk.gni")
  11. import("//build/vulkan/config.gni")
  12. }
  13. declare_args() {
  14. skia_enable_flutter_defines = false
  15. }
  16. declare_args() {
  17. skia_use_angle = false
  18. skia_use_egl = false
  19. skia_use_expat = true
  20. skia_use_experimental_xform = false
  21. skia_use_ffmpeg = false
  22. skia_use_fontconfig = is_linux
  23. skia_use_fonthost_mac = is_mac
  24. skia_use_freetype = is_android || is_fuchsia || is_linux
  25. skia_use_fixed_gamma_text = is_android
  26. skia_use_libjpeg_turbo = true
  27. skia_use_libpng = true
  28. skia_use_libwebp = !is_fuchsia
  29. skia_use_lua = is_skia_dev_build && !is_ios
  30. skia_use_opencl = false
  31. skia_use_piex = !is_win
  32. skia_use_wuffs = false
  33. skia_use_zlib = true
  34. skia_use_metal = false
  35. skia_use_dawn = false
  36. skia_use_libheif = is_skia_dev_build
  37. skia_use_x11 = false
  38. skia_use_xps = true
  39. }
  40. declare_args() {
  41. skia_android_serial = ""
  42. skia_enable_ccpr = true
  43. skia_enable_nvpr = !skia_enable_flutter_defines
  44. skia_enable_discrete_gpu = true
  45. skia_enable_pdf = true
  46. skia_enable_spirv_validation = is_skia_dev_build && is_debug && !skia_use_dawn
  47. skia_enable_skpicture = true
  48. skia_enable_sksl_interpreter = is_skia_dev_build
  49. skia_enable_skvm_jit =
  50. is_skia_dev_build && ((target_cpu == "x64" && (is_linux || is_mac)) ||
  51. (target_cpu == "arm64" && is_android))
  52. skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
  53. skia_qt_path = getenv("QT_PATH")
  54. skia_compile_processors = false
  55. skia_generate_workarounds = false
  56. skia_lex = false
  57. skia_skqp_global_error_tolerance = 0
  58. skia_llvm_path = ""
  59. skia_llvm_lib = "LLVM"
  60. skia_tools_require_resources = false
  61. skia_include_multiframe_procs = false
  62. }
  63. if (skia_use_dawn) {
  64. import("third_party/externals/dawn/scripts/dawn_features.gni")
  65. }
  66. declare_args() {
  67. skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
  68. skia_use_sfntly = skia_use_icu
  69. skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
  70. skia_enable_fontmgr_empty = false
  71. skia_enable_fontmgr_custom =
  72. is_linux && skia_use_freetype && !skia_use_fontconfig
  73. skia_enable_fontmgr_custom_empty = is_fuchsia && skia_use_freetype
  74. skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
  75. skia_enable_fontmgr_fuchsia = is_fuchsia
  76. skia_enable_fontmgr_win = is_win
  77. skia_enable_fontmgr_win_gdi = is_win
  78. if (is_mac) {
  79. skia_gl_standard = "gl"
  80. } else if (is_ios) {
  81. skia_gl_standard = "gles"
  82. } else if (is_linux) {
  83. skia_gl_standard = "gles"
  84. } else {
  85. skia_gl_standard = ""
  86. }
  87. if (is_android) {
  88. skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
  89. } else if (is_fuchsia) {
  90. skia_use_vulkan = fuchsia_use_vulkan
  91. } else {
  92. skia_use_vulkan = defined(skia_moltenvk_path) && skia_moltenvk_path != ""
  93. }
  94. if (is_ios) {
  95. skia_ios_identity = ".*Google.*"
  96. skia_ios_profile = "Google Development"
  97. }
  98. }
  99. if (defined(skia_settings)) {
  100. import(skia_settings)
  101. }
  102. # Skia public API, generally provided by :skia.
  103. config("skia_public") {
  104. include_dirs = [ "." ]
  105. defines = []
  106. if (is_component_build) {
  107. defines += [ "SKIA_DLL" ]
  108. }
  109. if (is_fuchsia || is_linux) {
  110. defines += [ "SK_R32_SHIFT=16" ]
  111. }
  112. if (skia_enable_flutter_defines) {
  113. defines += flutter_defines
  114. }
  115. if (!skia_enable_gpu) {
  116. defines += [ "SK_SUPPORT_GPU=0" ]
  117. }
  118. if (skia_enable_atlas_text) {
  119. defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
  120. }
  121. if (is_fuchsia) {
  122. defines += fuchsia_defines
  123. }
  124. if (skia_gl_standard == "gles") {
  125. defines += [ "SK_ASSUME_GL_ES=1" ]
  126. } else if (skia_gl_standard == "gl") {
  127. defines += [ "SK_ASSUME_GL=1" ]
  128. } else if (skia_gl_standard == "webgl") {
  129. defines += [ "SK_ASSUME_WEBGL=1" ]
  130. }
  131. }
  132. # Skia internal APIs, used by Skia itself and a few test tools.
  133. config("skia_private") {
  134. visibility = [ ":*" ]
  135. defines = [ "SK_GAMMA_APPLY_TO_A8" ]
  136. if (skia_use_fixed_gamma_text) {
  137. defines += [
  138. "SK_GAMMA_EXPONENT=1.4",
  139. "SK_GAMMA_CONTRAST=0.0",
  140. ]
  141. }
  142. if (is_skia_dev_build) {
  143. defines += [
  144. "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
  145. "GR_TEST_UTILS=1",
  146. ]
  147. }
  148. libs = []
  149. lib_dirs = []
  150. if (skia_use_angle) {
  151. defines += [ "SK_ANGLE" ]
  152. }
  153. if (skia_llvm_path != "") {
  154. defines += [ "SK_LLVM_AVAILABLE" ]
  155. include_dirs += [ "$skia_llvm_path/include" ]
  156. libs += [ skia_llvm_lib ]
  157. lib_dirs += [ "$skia_llvm_path/lib/" ]
  158. }
  159. }
  160. # Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
  161. config("skia_library") {
  162. visibility = [ ":*" ]
  163. defines = [ "SKIA_IMPLEMENTATION=1" ]
  164. }
  165. skia_library_configs = [
  166. ":skia_public",
  167. ":skia_private",
  168. ":skia_library",
  169. ]
  170. # Use for CPU-specific Skia code that needs particular compiler flags.
  171. template("opts") {
  172. visibility = [ ":*" ]
  173. if (invoker.enabled) {
  174. source_set(target_name) {
  175. check_includes = false
  176. forward_variables_from(invoker, "*")
  177. configs += skia_library_configs
  178. }
  179. } else {
  180. # If not enabled, a phony empty target that swallows all otherwise unused variables.
  181. source_set(target_name) {
  182. check_includes = false
  183. forward_variables_from(invoker,
  184. "*",
  185. [
  186. "sources",
  187. "cflags",
  188. ])
  189. }
  190. }
  191. }
  192. is_x86 = current_cpu == "x64" || current_cpu == "x86"
  193. opts("riscv64") {
  194. enabled = current_cpu == "riscv64"
  195. sources = skia_opts.none_sources
  196. cflags = []
  197. }
  198. opts("none") {
  199. enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
  200. sources = skia_opts.none_sources
  201. cflags = []
  202. }
  203. opts("armv7") {
  204. enabled = current_cpu == "arm"
  205. sources = skia_opts.armv7_sources + skia_opts.neon_sources
  206. cflags = []
  207. }
  208. opts("arm64") {
  209. enabled = current_cpu == "arm64"
  210. sources = skia_opts.arm64_sources
  211. cflags = []
  212. }
  213. opts("crc32") {
  214. enabled = current_cpu == "arm64"
  215. sources = skia_opts.crc32_sources
  216. cflags = [ "-march=armv8-a+crc" ]
  217. }
  218. opts("sse2") {
  219. enabled = is_x86
  220. sources = skia_opts.sse2_sources
  221. if (!is_clang && is_win) {
  222. defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
  223. } else {
  224. cflags = [ "-msse2" ]
  225. }
  226. }
  227. opts("ssse3") {
  228. enabled = is_x86
  229. sources = skia_opts.ssse3_sources
  230. if (!is_clang && is_win) {
  231. defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
  232. } else {
  233. cflags = [ "-mssse3" ]
  234. }
  235. }
  236. opts("sse41") {
  237. enabled = is_x86
  238. sources = skia_opts.sse41_sources
  239. if (!is_clang && is_win) {
  240. defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
  241. } else {
  242. cflags = [ "-msse4.1" ]
  243. }
  244. }
  245. opts("sse42") {
  246. enabled = is_x86
  247. sources = skia_opts.sse42_sources
  248. if (!is_clang && is_win) {
  249. defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
  250. } else {
  251. cflags = [ "-msse4.2" ]
  252. }
  253. }
  254. opts("avx") {
  255. enabled = is_x86
  256. sources = skia_opts.avx_sources
  257. if (is_win) {
  258. cflags = [ "/arch:AVX" ]
  259. } else {
  260. cflags = [ "-mavx" ]
  261. }
  262. }
  263. opts("hsw") {
  264. enabled = is_x86
  265. sources = skia_opts.hsw_sources
  266. if (is_win) {
  267. cflags = [ "/arch:AVX2" ]
  268. } else {
  269. cflags = [ "-march=haswell" ]
  270. }
  271. }
  272. # Any feature of Skia that requires third-party code should be optional and use this template.
  273. template("optional") {
  274. visibility = [ ":*" ]
  275. if (invoker.enabled) {
  276. config(target_name + "_public") {
  277. if (defined(invoker.public_defines)) {
  278. defines = invoker.public_defines
  279. }
  280. if (defined(invoker.public_configs)) {
  281. configs = invoker.public_configs
  282. }
  283. }
  284. source_set(target_name) {
  285. check_includes = false
  286. forward_variables_from(invoker,
  287. "*",
  288. [
  289. "public_defines",
  290. "sources_when_disabled",
  291. "configs_to_remove",
  292. ])
  293. all_dependent_configs = [ ":" + target_name + "_public" ]
  294. configs += skia_library_configs
  295. if (defined(invoker.configs_to_remove)) {
  296. configs -= invoker.configs_to_remove
  297. }
  298. }
  299. } else {
  300. source_set(target_name) {
  301. forward_variables_from(invoker,
  302. "*",
  303. [
  304. "public_defines",
  305. "public_deps",
  306. "deps",
  307. "libs",
  308. "sources",
  309. "sources_when_disabled",
  310. "configs_to_remove",
  311. ])
  312. if (defined(invoker.sources_when_disabled)) {
  313. sources = invoker.sources_when_disabled
  314. }
  315. configs += skia_library_configs
  316. }
  317. }
  318. }
  319. optional("fontmgr_android") {
  320. enabled = skia_enable_fontmgr_android
  321. deps = [
  322. ":typeface_freetype",
  323. "//third_party/expat",
  324. ]
  325. sources = [
  326. "src/ports/SkFontMgr_android.cpp",
  327. "src/ports/SkFontMgr_android_factory.cpp",
  328. "src/ports/SkFontMgr_android_parser.cpp",
  329. ]
  330. }
  331. optional("fontmgr_custom") {
  332. enabled = skia_enable_fontmgr_custom
  333. deps = [
  334. ":typeface_freetype",
  335. ]
  336. sources = [
  337. "src/ports/SkFontMgr_custom.cpp",
  338. "src/ports/SkFontMgr_custom.h",
  339. "src/ports/SkFontMgr_custom_directory.cpp",
  340. "src/ports/SkFontMgr_custom_directory_factory.cpp",
  341. "src/ports/SkFontMgr_custom_embedded.cpp",
  342. "src/ports/SkFontMgr_custom_empty.cpp",
  343. ]
  344. }
  345. optional("fontmgr_custom_empty") {
  346. enabled = skia_enable_fontmgr_custom_empty
  347. deps = [
  348. ":typeface_freetype",
  349. ]
  350. sources = [
  351. "src/ports/SkFontMgr_custom.cpp",
  352. "src/ports/SkFontMgr_custom_empty.cpp",
  353. "src/ports/SkFontMgr_custom_empty_factory.cpp",
  354. ]
  355. }
  356. optional("fontmgr_empty") {
  357. enabled = skia_enable_fontmgr_empty
  358. sources = [
  359. "src/ports/SkFontMgr_empty_factory.cpp",
  360. ]
  361. }
  362. optional("fontmgr_fontconfig") {
  363. enabled = skia_use_freetype && skia_use_fontconfig
  364. deps = [
  365. ":typeface_freetype",
  366. "//third_party:fontconfig",
  367. ]
  368. sources = [
  369. "src/ports/SkFontConfigInterface.cpp",
  370. "src/ports/SkFontConfigInterface_direct.cpp",
  371. "src/ports/SkFontConfigInterface_direct_factory.cpp",
  372. "src/ports/SkFontMgr_FontConfigInterface.cpp",
  373. "src/ports/SkFontMgr_fontconfig.cpp",
  374. "src/ports/SkFontMgr_fontconfig_factory.cpp",
  375. ]
  376. }
  377. optional("fontmgr_fuchsia") {
  378. enabled = skia_enable_fontmgr_fuchsia
  379. deps = []
  380. if (is_fuchsia && using_fuchsia_sdk) {
  381. deps += [ "$fuchsia_sdk_root/fidl:fuchsia.fonts" ]
  382. } else {
  383. deps += [ "//sdk/fidl/fuchsia.fonts" ]
  384. }
  385. sources = [
  386. "src/ports/SkFontMgr_fuchsia.cpp",
  387. "src/ports/SkFontMgr_fuchsia.h",
  388. ]
  389. }
  390. optional("fontmgr_wasm") {
  391. enabled = !skia_enable_fontmgr_empty && target_cpu == "wasm"
  392. deps = [
  393. ":typeface_freetype",
  394. ]
  395. sources = [
  396. "src/ports/SkFontMgr_custom.cpp",
  397. "src/ports/SkFontMgr_custom.h",
  398. "src/ports/SkFontMgr_custom_embedded.cpp",
  399. "src/ports/SkFontMgr_custom_embedded_factory.cpp",
  400. ]
  401. }
  402. optional("fontmgr_win") {
  403. enabled = skia_enable_fontmgr_win
  404. sources = [
  405. "src/fonts/SkFontMgr_indirect.cpp",
  406. "src/ports/SkFontMgr_win_dw.cpp",
  407. "src/ports/SkFontMgr_win_dw_factory.cpp",
  408. "src/ports/SkScalerContext_win_dw.cpp",
  409. "src/ports/SkTypeface_win_dw.cpp",
  410. ]
  411. }
  412. optional("fontmgr_win_gdi") {
  413. enabled = skia_enable_fontmgr_win_gdi
  414. sources = [
  415. "src/ports/SkFontHost_win.cpp",
  416. ]
  417. libs = [ "Gdi32.lib" ]
  418. }
  419. if (skia_lex) {
  420. executable("sksllex") {
  421. sources = [
  422. "src/sksl/lex/Main.cpp",
  423. "src/sksl/lex/NFA.cpp",
  424. "src/sksl/lex/RegexNode.cpp",
  425. "src/sksl/lex/RegexParser.cpp",
  426. ]
  427. include_dirs = [ "." ]
  428. }
  429. action("run_sksllex") {
  430. script = "gn/run_sksllex.py"
  431. deps = [
  432. ":sksllex(//gn/toolchain:$host_toolchain)",
  433. ]
  434. sources = [
  435. "src/sksl/lex/sksl.lex",
  436. ]
  437. # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
  438. # path that starts with target_out_dir and then uses ".." to back up into the src dir.
  439. outputs = [
  440. "$target_out_dir/" +
  441. rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
  442. # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
  443. # confused due to the same file being named by two different paths
  444. ]
  445. sksllex_path = "$root_out_dir/"
  446. sksllex_path += "sksllex"
  447. if (host_os == "win") {
  448. sksllex_path += ".exe"
  449. }
  450. args = [
  451. rebase_path(sksllex_path),
  452. rebase_path("bin/clang-format"),
  453. rebase_path("src"),
  454. ]
  455. }
  456. } else {
  457. group("run_sksllex") {
  458. }
  459. }
  460. if (skia_compile_processors) {
  461. executable("skslc") {
  462. defines = [ "SKSL_STANDALONE" ]
  463. sources = [
  464. "src/sksl/SkSLMain.cpp",
  465. ]
  466. sources += skia_sksl_sources
  467. sources += skia_sksl_gpu_sources
  468. include_dirs = [ "." ]
  469. deps = [
  470. ":run_sksllex",
  471. "//third_party/spirv-tools",
  472. ]
  473. }
  474. skia_gpu_processor_outputs = []
  475. foreach(src, skia_gpu_processor_sources) {
  476. dir = get_path_info(src, "dir")
  477. name = get_path_info(src, "name")
  478. # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
  479. # path that starts with target_out_dir and then uses ".." to back up into the src dir.
  480. skia_gpu_processor_outputs += [
  481. "$target_out_dir/" +
  482. rebase_path("$dir/generated/$name.h", target_out_dir),
  483. # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
  484. # confused due to the same file being named by two different paths
  485. ]
  486. }
  487. action("create_sksl_enums") {
  488. script = "gn/create_sksl_enums.py"
  489. sources = [
  490. "include/private/GrSharedEnums.h",
  491. ]
  492. outputs = [
  493. "$target_out_dir/" +
  494. rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
  495. ]
  496. args = [
  497. rebase_path(sources[0]),
  498. rebase_path(outputs[0]),
  499. ]
  500. }
  501. action("compile_processors") {
  502. script = "gn/compile_processors.py"
  503. deps = [
  504. ":create_sksl_enums",
  505. ":skslc(//gn/toolchain:$host_toolchain)",
  506. ]
  507. sources = skia_gpu_processor_sources
  508. outputs = skia_gpu_processor_outputs
  509. skslc_path = "$root_out_dir/"
  510. if (host_toolchain != default_toolchain_name) {
  511. skslc_path += "$host_toolchain/"
  512. }
  513. skslc_path += "skslc"
  514. if (host_os == "win") {
  515. skslc_path += ".exe"
  516. }
  517. args = [
  518. rebase_path(skslc_path),
  519. rebase_path("bin/clang-format"),
  520. ]
  521. args += rebase_path(skia_gpu_processor_sources)
  522. }
  523. } else {
  524. skia_gpu_processor_outputs = []
  525. group("compile_processors") {
  526. }
  527. }
  528. optional("gpu") {
  529. enabled = skia_enable_gpu
  530. deps = [
  531. ":compile_processors",
  532. ":run_sksllex",
  533. ]
  534. if (skia_generate_workarounds) {
  535. deps += [ ":workaround_list" ]
  536. }
  537. public_defines = [ "SK_GL" ]
  538. public_configs = []
  539. public_deps = []
  540. sources =
  541. skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs
  542. if (!skia_enable_ccpr) {
  543. sources -= skia_ccpr_sources
  544. sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
  545. }
  546. if (!skia_enable_nvpr) {
  547. sources -= skia_nvpr_sources
  548. sources += [ "src/gpu/GrPathRendering_none.cpp" ]
  549. }
  550. # These paths need to be absolute to match the ones produced by shared_sources.gni.
  551. sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
  552. "abspath")
  553. libs = []
  554. if (is_android) {
  555. sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
  556. # this lib is required to link against AHardwareBuffer
  557. if (defined(ndk_api) && ndk_api >= 26) {
  558. libs += [ "android" ]
  559. }
  560. } else if (skia_use_egl) {
  561. sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
  562. libs += [ "EGL" ]
  563. } else if (is_linux && skia_use_x11) {
  564. sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
  565. libs += [ "GL" ]
  566. } else if (is_mac) {
  567. sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
  568. } else if (is_ios) {
  569. sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
  570. } else if (is_win) {
  571. sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
  572. if (target_cpu != "arm64") {
  573. libs += [ "OpenGL32.lib" ]
  574. }
  575. } else {
  576. sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
  577. }
  578. if (skia_use_vulkan) {
  579. public_defines += [ "SK_VULKAN" ]
  580. deps += [ "third_party/vulkanmemoryallocator" ]
  581. sources += skia_vk_sources
  582. if (skia_enable_vulkan_debug_layers) {
  583. public_defines += [ "SK_ENABLE_VK_LAYERS" ]
  584. }
  585. if (is_fuchsia) {
  586. if (using_fuchsia_sdk) {
  587. public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
  588. } else {
  589. public_deps += [ "//src/graphics/lib/vulkan" ]
  590. }
  591. }
  592. }
  593. if (skia_use_dawn) {
  594. public_defines += [ "SK_DAWN" ]
  595. sources += skia_dawn_sources
  596. public_deps += [
  597. "//third_party/dawn:dawn_headers",
  598. "//third_party/dawn:libdawn",
  599. "//third_party/dawn:libdawn_native_sources",
  600. ]
  601. if (dawn_enable_d3d12) {
  602. libs += [
  603. "d3d12.lib",
  604. "dxgi.lib",
  605. "d3dcompiler.lib",
  606. ]
  607. } else if (dawn_enable_metal) {
  608. libs += [ "Metal.framework" ]
  609. }
  610. }
  611. cflags_objcc = []
  612. if (skia_use_metal) {
  613. public_defines += [ "SK_METAL" ]
  614. sources += skia_metal_sources
  615. libs += [ "Metal.framework" ]
  616. libs += [ "Foundation.framework" ]
  617. cflags_objcc += [ "-fobjc-arc" ]
  618. }
  619. if (skia_enable_atlas_text) {
  620. sources += skia_atlas_text_sources
  621. }
  622. if (is_debug) {
  623. public_defines += [ "SK_ENABLE_DUMP_GPU" ]
  624. }
  625. }
  626. optional("gif") {
  627. enabled = !skia_use_wuffs
  628. sources = [
  629. "src/codec/SkGifCodec.cpp",
  630. "third_party/gif/SkGifImageReader.cpp",
  631. ]
  632. }
  633. optional("heif") {
  634. enabled = skia_use_libheif
  635. public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
  636. deps = []
  637. sources = [
  638. "src/codec/SkHeifCodec.cpp",
  639. ]
  640. }
  641. optional("jpeg") {
  642. enabled = skia_use_libjpeg_turbo
  643. public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
  644. deps = [
  645. "//third_party/libjpeg-turbo:libjpeg",
  646. ]
  647. public = [
  648. "include/encode/SkJpegEncoder.h",
  649. ]
  650. sources = [
  651. "src/codec/SkJpegCodec.cpp",
  652. "src/codec/SkJpegDecoderMgr.cpp",
  653. "src/codec/SkJpegUtility.cpp",
  654. "src/images/SkJPEGWriteUtility.cpp",
  655. "src/images/SkJpegEncoder.cpp",
  656. ]
  657. }
  658. optional("pdf") {
  659. enabled = skia_use_zlib && skia_enable_pdf
  660. public_defines = [ "SK_SUPPORT_PDF" ]
  661. deps = [
  662. "//third_party/zlib",
  663. ]
  664. if (skia_use_libjpeg_turbo) {
  665. deps += [ ":jpeg" ]
  666. }
  667. sources = skia_pdf_sources
  668. sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
  669. if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
  670. deps += [ "//third_party/harfbuzz" ]
  671. defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
  672. } else if (skia_use_icu && skia_use_sfntly) {
  673. deps += [ "//third_party/sfntly" ]
  674. defines = [ "SK_PDF_USE_SFNTLY" ]
  675. }
  676. }
  677. optional("png") {
  678. enabled = skia_use_libpng
  679. public_defines = [ "SK_HAS_PNG_LIBRARY" ]
  680. deps = [
  681. "//third_party/libpng",
  682. ]
  683. sources = [
  684. "src/codec/SkIcoCodec.cpp",
  685. "src/codec/SkPngCodec.cpp",
  686. "src/images/SkPngEncoder.cpp",
  687. ]
  688. }
  689. optional("raw") {
  690. enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
  691. public_defines = [ "SK_CODEC_DECODES_RAW" ]
  692. deps = [
  693. "//third_party/dng_sdk",
  694. "//third_party/libjpeg-turbo:libjpeg",
  695. "//third_party/piex",
  696. ]
  697. # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
  698. # Skia.
  699. configs_to_remove = [ "//gn:no_exceptions" ]
  700. sources = [
  701. "src/codec/SkRawCodec.cpp",
  702. ]
  703. }
  704. import("third_party/skcms/skcms.gni")
  705. source_set("skcms") {
  706. cflags = []
  707. if (!is_win || is_clang) {
  708. cflags += [
  709. "-w",
  710. "-std=c11",
  711. ]
  712. }
  713. public = [
  714. "include/third_party/skcms/skcms.h",
  715. ]
  716. include_dirs = [ "include/third_party/skcms" ]
  717. sources = rebase_path(skcms_sources, ".", "third_party/skcms")
  718. }
  719. optional("typeface_freetype") {
  720. enabled = skia_use_freetype
  721. deps = [
  722. "//third_party/freetype2",
  723. ]
  724. sources = [
  725. "src/ports/SkFontHost_FreeType.cpp",
  726. "src/ports/SkFontHost_FreeType_common.cpp",
  727. ]
  728. }
  729. optional("webp") {
  730. enabled = skia_use_libwebp
  731. public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
  732. deps = [
  733. "//third_party/libwebp",
  734. ]
  735. sources = [
  736. "src/codec/SkWebpCodec.cpp",
  737. "src/images/SkWebpEncoder.cpp",
  738. ]
  739. }
  740. optional("wuffs") {
  741. enabled = skia_use_wuffs
  742. public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
  743. deps = [
  744. "//third_party/wuffs",
  745. ]
  746. sources = [
  747. "src/codec/SkWuffsCodec.cpp",
  748. ]
  749. }
  750. optional("xml") {
  751. enabled = skia_use_expat
  752. public_defines = [ "SK_XML" ]
  753. deps = [
  754. "//third_party/expat",
  755. ]
  756. sources = [
  757. "src/svg/SkSVGCanvas.cpp",
  758. "src/svg/SkSVGDevice.cpp",
  759. "src/xml/SkDOM.cpp",
  760. "src/xml/SkXMLParser.cpp",
  761. "src/xml/SkXMLWriter.cpp",
  762. ]
  763. }
  764. optional("sksl_interpreter") {
  765. enabled = skia_enable_sksl_interpreter
  766. public_defines = [ "SK_ENABLE_SKSL_INTERPRETER" ]
  767. }
  768. optional("skvm_jit") {
  769. enabled = skia_enable_skvm_jit
  770. public_defines = [ "SKVM_JIT" ]
  771. }
  772. if (skia_enable_gpu && skia_generate_workarounds) {
  773. action("workaround_list") {
  774. script = "tools/build_workaround_header.py"
  775. inputs = [
  776. "src/gpu/gpu_workaround_list.txt",
  777. ]
  778. # see comments in skia_compile_processors about out dir path shenanigans.
  779. output_file =
  780. rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
  781. outputs = [
  782. "$root_out_dir/$output_file",
  783. ]
  784. args = [
  785. "--output-file",
  786. "$output_file",
  787. ]
  788. foreach(file, inputs) {
  789. args += [ rebase_path(file, root_build_dir) ]
  790. }
  791. }
  792. }
  793. component("skia") {
  794. public_configs = [ ":skia_public" ]
  795. configs += skia_library_configs
  796. public_deps = [
  797. ":gpu",
  798. ":pdf",
  799. ":skcms",
  800. ]
  801. deps = [
  802. ":arm64",
  803. ":armv7",
  804. ":avx",
  805. ":compile_processors",
  806. ":crc32",
  807. ":fontmgr_android",
  808. ":fontmgr_custom",
  809. ":fontmgr_custom_empty",
  810. ":fontmgr_empty",
  811. ":fontmgr_fontconfig",
  812. ":fontmgr_fuchsia",
  813. ":fontmgr_wasm",
  814. ":fontmgr_win",
  815. ":fontmgr_win_gdi",
  816. ":gif",
  817. ":heif",
  818. ":hsw",
  819. ":jpeg",
  820. ":none",
  821. ":png",
  822. ":raw",
  823. ":sksl_interpreter",
  824. ":skvm_jit",
  825. ":sse2",
  826. ":sse41",
  827. ":sse42",
  828. ":ssse3",
  829. ":webp",
  830. ":wuffs",
  831. ":xml",
  832. ]
  833. # This file (and all GN files in Skia) are designed to work with an
  834. # empty sources assignment filter; we handle all that explicitly.
  835. # We clear the filter here for clients who may have set up a global filter.
  836. set_sources_assignment_filter([])
  837. public = skia_core_public
  838. public += skia_utils_public
  839. public += skia_effects_public
  840. public += skia_effects_imagefilter_public
  841. public += skia_xps_public
  842. sources = []
  843. sources += skia_core_sources
  844. sources += skia_utils_sources
  845. if (skia_use_xps) {
  846. sources += skia_xps_sources
  847. }
  848. sources += skia_effects_sources
  849. sources += skia_effects_imagefilter_sources
  850. sources += skia_sksl_sources
  851. sources += [
  852. "src/android/SkAndroidFrameworkUtils.cpp",
  853. "src/android/SkAnimatedImage.cpp",
  854. "src/android/SkBitmapRegionCodec.cpp",
  855. "src/android/SkBitmapRegionDecoder.cpp",
  856. "src/codec/SkAndroidCodec.cpp",
  857. "src/codec/SkAndroidCodecAdapter.cpp",
  858. "src/codec/SkBmpBaseCodec.cpp",
  859. "src/codec/SkBmpCodec.cpp",
  860. "src/codec/SkBmpMaskCodec.cpp",
  861. "src/codec/SkBmpRLECodec.cpp",
  862. "src/codec/SkBmpStandardCodec.cpp",
  863. "src/codec/SkCodec.cpp",
  864. "src/codec/SkCodecImageGenerator.cpp",
  865. "src/codec/SkColorTable.cpp",
  866. "src/codec/SkEncodedInfo.cpp",
  867. "src/codec/SkMaskSwizzler.cpp",
  868. "src/codec/SkMasks.cpp",
  869. "src/codec/SkSampledCodec.cpp",
  870. "src/codec/SkSampler.cpp",
  871. "src/codec/SkStreamBuffer.cpp",
  872. "src/codec/SkSwizzler.cpp",
  873. "src/codec/SkWbmpCodec.cpp",
  874. "src/images/SkImageEncoder.cpp",
  875. "src/ports/SkDiscardableMemory_none.cpp",
  876. "src/ports/SkGlobalInitialization_default.cpp",
  877. "src/ports/SkImageGenerator_skia.cpp",
  878. "src/ports/SkMemory_malloc.cpp",
  879. "src/ports/SkOSFile_stdio.cpp",
  880. "src/sfnt/SkOTTable_name.cpp",
  881. "src/sfnt/SkOTUtils.cpp",
  882. "src/utils/mac/SkStream_mac.cpp",
  883. ]
  884. defines = []
  885. if (!skia_enable_skpicture) {
  886. defines = [ "SK_DISABLE_SKPICTURE" ]
  887. public -= skia_skpicture_public
  888. sources -= skia_skpicture_sources
  889. sources -= [ "//src/effects/imagefilters/SkPictureImageFilter.cpp" ]
  890. sources += [ "src/core/SkPicture_none.cpp" ]
  891. }
  892. libs = []
  893. if (is_win) {
  894. sources += [
  895. "src/ports/SkDebug_win.cpp",
  896. "src/ports/SkImageEncoder_WIC.cpp",
  897. "src/ports/SkImageGeneratorWIC.cpp",
  898. "src/ports/SkOSFile_win.cpp",
  899. "src/ports/SkOSLibrary_win.cpp",
  900. "src/ports/SkTLS_win.cpp",
  901. ]
  902. libs += [
  903. "FontSub.lib",
  904. "Ole32.lib",
  905. "OleAut32.lib",
  906. "User32.lib",
  907. "Usp10.lib",
  908. ]
  909. } else {
  910. sources += [
  911. "src/ports/SkOSFile_posix.cpp",
  912. "src/ports/SkOSLibrary_posix.cpp",
  913. "src/ports/SkTLS_pthread.cpp",
  914. ]
  915. libs += [ "dl" ]
  916. }
  917. if (is_android) {
  918. deps += [ "//third_party/expat" ]
  919. if (defined(ndk) && ndk != "") {
  920. deps += [ "//third_party/cpu-features" ]
  921. }
  922. sources += [ "src/ports/SkDebug_android.cpp" ]
  923. libs += [
  924. "EGL",
  925. "GLESv2",
  926. "log",
  927. ]
  928. }
  929. if (is_linux || target_cpu == "wasm") {
  930. sources += [ "src/ports/SkDebug_stdio.cpp" ]
  931. if (skia_use_egl) {
  932. libs += [ "GLESv2" ]
  933. }
  934. }
  935. if (skia_use_fonthost_mac) {
  936. sources += [ "src/ports/SkFontHost_mac.cpp" ]
  937. }
  938. if (is_mac) {
  939. sources += [
  940. "src/ports/SkDebug_stdio.cpp",
  941. "src/ports/SkImageEncoder_CG.cpp",
  942. "src/ports/SkImageGeneratorCG.cpp",
  943. ]
  944. libs += [
  945. # AppKit symbols NSFontWeightXXX may be dlsym'ed.
  946. "AppKit.framework",
  947. "ApplicationServices.framework",
  948. "OpenGL.framework",
  949. ]
  950. }
  951. if (is_ios) {
  952. sources += [
  953. "src/ports/SkDebug_stdio.cpp",
  954. "src/ports/SkFontHost_mac.cpp",
  955. "src/ports/SkImageEncoder_CG.cpp",
  956. "src/ports/SkImageGeneratorCG.cpp",
  957. ]
  958. libs += [
  959. "CoreFoundation.framework",
  960. "CoreGraphics.framework",
  961. "CoreText.framework",
  962. "ImageIO.framework",
  963. "MobileCoreServices.framework",
  964. # UIKit symbols UIFontWeightXXX may be dlsym'ed.
  965. "UIKit.framework",
  966. ]
  967. }
  968. if (is_fuchsia) {
  969. sources += [ "src/ports/SkDebug_stdio.cpp" ]
  970. }
  971. if (skia_enable_spirv_validation) {
  972. deps += [ "//third_party/spirv-tools" ]
  973. defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
  974. }
  975. if (skia_include_multiframe_procs) {
  976. sources += [ "tools/SkSharingProc.cpp" ]
  977. }
  978. }
  979. # DebugCanvas used in experimental/wasm-skp-debugger
  980. if (target_cpu == "wasm") {
  981. static_library("debugcanvas") {
  982. public_configs = [ ":skia_public" ]
  983. sources = [
  984. "tools/SkSharingProc.cpp",
  985. "tools/UrlDataManager.cpp",
  986. "tools/debugger/DebugCanvas.cpp",
  987. "tools/debugger/DrawCommand.cpp",
  988. "tools/debugger/JsonWriteBuffer.cpp",
  989. ]
  990. deps = [
  991. ":fontmgr_wasm",
  992. ]
  993. }
  994. }
  995. static_library("pathkit") {
  996. check_includes = false
  997. public_configs = [ ":skia_public" ]
  998. configs += skia_library_configs
  999. deps = [
  1000. ":arm64",
  1001. ":armv7",
  1002. ":avx",
  1003. ":crc32",
  1004. ":hsw",
  1005. ":none",
  1006. ":sse2",
  1007. ":sse41",
  1008. ":sse42",
  1009. ":ssse3",
  1010. ]
  1011. # This file (and all GN files in Skia) are designed to work with an
  1012. # empty sources assignment filter; we handle all that explicitly.
  1013. # We clear the filter here for clients who may have set up a global filter.
  1014. set_sources_assignment_filter([])
  1015. sources = []
  1016. sources += skia_pathops_sources
  1017. sources += skia_pathops_public
  1018. sources += [
  1019. "src/core/SkAnalyticEdge.cpp",
  1020. "src/core/SkArenaAlloc.cpp",
  1021. "src/core/SkContourMeasure.cpp",
  1022. "src/core/SkCubicMap.cpp",
  1023. "src/core/SkEdge.cpp",
  1024. "src/core/SkEdgeBuilder.cpp",
  1025. "src/core/SkEdgeClipper.cpp",
  1026. "src/core/SkGeometry.cpp",
  1027. "src/core/SkLineClipper.cpp",
  1028. "src/core/SkMallocPixelRef.cpp",
  1029. "src/core/SkMath.cpp",
  1030. "src/core/SkMatrix.cpp",
  1031. "src/core/SkOpts.cpp",
  1032. "src/core/SkPaint.cpp",
  1033. "src/core/SkPath.cpp",
  1034. "src/core/SkPathEffect.cpp",
  1035. "src/core/SkPathMeasure.cpp",
  1036. "src/core/SkPathRef.cpp",
  1037. "src/core/SkPoint.cpp",
  1038. "src/core/SkRRect.cpp",
  1039. "src/core/SkRect.cpp",
  1040. "src/core/SkSemaphore.cpp",
  1041. "src/core/SkStream.cpp",
  1042. "src/core/SkString.cpp",
  1043. "src/core/SkStringUtils.cpp",
  1044. "src/core/SkStroke.cpp",
  1045. "src/core/SkStrokeRec.cpp",
  1046. "src/core/SkStrokerPriv.cpp",
  1047. "src/core/SkThreadID.cpp",
  1048. "src/core/SkUtils.cpp",
  1049. "src/effects/SkDashPathEffect.cpp",
  1050. "src/effects/SkTrimPathEffect.cpp",
  1051. "src/ports/SkDebug_stdio.cpp",
  1052. "src/ports/SkMemory_malloc.cpp",
  1053. "src/utils/SkDashPath.cpp",
  1054. "src/utils/SkParse.cpp",
  1055. "src/utils/SkParsePath.cpp",
  1056. "src/utils/SkUTF.cpp",
  1057. ]
  1058. }
  1059. group("modules") {
  1060. deps = [
  1061. "modules/particles",
  1062. "modules/skottie",
  1063. "modules/skshaper",
  1064. ]
  1065. }
  1066. # Targets guarded by skia_enable_tools may use //third_party freely.
  1067. if (skia_enable_tools) {
  1068. skia_public_includes = [
  1069. "include/android",
  1070. "include/atlastext",
  1071. "include/c",
  1072. "include/codec",
  1073. "include/config",
  1074. "include/core",
  1075. "include/docs",
  1076. "include/effects",
  1077. "include/encode",
  1078. "include/gpu",
  1079. "include/pathops",
  1080. "include/ports",
  1081. "include/svg",
  1082. "include/utils",
  1083. "include/utils/mac",
  1084. "modules/sksg/include",
  1085. "modules/skshaper/include",
  1086. "modules/skottie/include",
  1087. ]
  1088. # Used by gn_to_bp.py to list our public include dirs.
  1089. source_set("public") {
  1090. configs += [ ":skia_public" ]
  1091. include_dirs = skia_public_includes
  1092. }
  1093. config("skia.h_config") {
  1094. include_dirs = [ "$target_gen_dir" ]
  1095. }
  1096. action("skia.h") {
  1097. public_configs = [ ":skia.h_config" ]
  1098. skia_h = "$target_gen_dir/skia.h"
  1099. script = "gn/find_headers.py"
  1100. args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
  1101. [ rebase_path(skia_h, root_build_dir) ] +
  1102. rebase_path(skia_public_includes)
  1103. depfile = "$skia_h.deps"
  1104. outputs = [
  1105. skia_h,
  1106. ]
  1107. }
  1108. if (target_cpu == "x64") {
  1109. executable("fiddle") {
  1110. check_includes = false
  1111. libs = []
  1112. sources = [
  1113. "tools/fiddle/draw.cpp",
  1114. "tools/fiddle/fiddle_main.cpp",
  1115. ]
  1116. if (skia_use_egl) {
  1117. sources += [ "tools/fiddle/egl_context.cpp" ]
  1118. } else {
  1119. sources += [ "tools/fiddle/null_context.cpp" ]
  1120. }
  1121. testonly = true
  1122. deps = [
  1123. ":flags",
  1124. ":gpu_tool_utils",
  1125. ":skia",
  1126. ":skia.h",
  1127. "modules/skottie",
  1128. "modules/skshaper",
  1129. ]
  1130. }
  1131. }
  1132. config("our_vulkan_headers") {
  1133. # We add this directory to simulate the client already have
  1134. # vulkan/vulkan_core.h on their path.
  1135. include_dirs = [ "include/third_party/vulkan" ]
  1136. }
  1137. source_set("public_headers_warnings_check") {
  1138. sources = [
  1139. "tools/public_headers_warnings_check.cpp",
  1140. ]
  1141. configs -= [ "//gn:warnings_except_public_headers" ]
  1142. configs += [ ":our_vulkan_headers" ]
  1143. deps = [
  1144. ":skia",
  1145. ":skia.h",
  1146. "modules/skottie",
  1147. "modules/skshaper",
  1148. ]
  1149. if (skia_use_dawn) {
  1150. deps += [ "//third_party/dawn:dawn_headers" ]
  1151. }
  1152. }
  1153. template("test_lib") {
  1154. config(target_name + "_config") {
  1155. if (defined(invoker.public_defines)) {
  1156. defines = invoker.public_defines
  1157. }
  1158. }
  1159. source_set(target_name) {
  1160. forward_variables_from(invoker, "*", [])
  1161. check_includes = false
  1162. public_configs = [
  1163. ":" + target_name + "_config",
  1164. ":skia_private",
  1165. ]
  1166. if (!defined(deps)) {
  1167. deps = []
  1168. }
  1169. deps += [ ":skia" ]
  1170. testonly = true
  1171. }
  1172. }
  1173. template("test_app") {
  1174. if (is_ios) {
  1175. app_name = target_name
  1176. gen_path = target_gen_dir
  1177. action("${app_name}_generate_info_plist") {
  1178. script = "//gn/gen_plist_ios.py"
  1179. outputs = [
  1180. "$gen_path/${app_name}_Info.plist",
  1181. ]
  1182. args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
  1183. }
  1184. bundle_data("${app_name}_bundle_info_plist") {
  1185. public_deps = [
  1186. ":${app_name}_generate_info_plist",
  1187. ]
  1188. sources = [
  1189. "$gen_path/${app_name}_Info.plist",
  1190. ]
  1191. outputs = [
  1192. "{{bundle_root_dir}}/Info.plist",
  1193. ]
  1194. }
  1195. has_skps = "True" == exec_script("//gn/checkdir.py",
  1196. [ rebase_path("skps", root_build_dir) ],
  1197. "trim string")
  1198. bundle_data("${app_name}_bundle_resources") {
  1199. sources = [
  1200. "resources",
  1201. ]
  1202. outputs = [
  1203. # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
  1204. "{{bundle_resources_dir}}/data/resources",
  1205. ]
  1206. }
  1207. if (has_skps) {
  1208. bundle_data("${app_name}_bundle_skps") {
  1209. sources = [
  1210. "skps",
  1211. ]
  1212. outputs = [
  1213. # Store in same folder as resources
  1214. "{{bundle_resources_dir}}/data/skps",
  1215. ]
  1216. }
  1217. }
  1218. executable("${app_name}_generate_executable") {
  1219. forward_variables_from(invoker,
  1220. "*",
  1221. [
  1222. "output_name",
  1223. "visibility",
  1224. "is_shared_library",
  1225. ])
  1226. configs += [ ":skia_private" ]
  1227. testonly = true
  1228. output_name = rebase_path("$gen_path/$app_name", root_build_dir)
  1229. }
  1230. bundle_data("${app_name}_bundle_executable") {
  1231. public_deps = [
  1232. ":${app_name}_generate_executable",
  1233. ]
  1234. sources = [
  1235. "$gen_path/$app_name",
  1236. ]
  1237. outputs = [
  1238. "{{bundle_executable_dir}}/$app_name",
  1239. ]
  1240. testonly = true
  1241. }
  1242. bundle_data("${app_name}_bundle_symbols") {
  1243. public_deps = [
  1244. ":${app_name}_generate_executable",
  1245. ]
  1246. sources = [
  1247. "$gen_path/${app_name}.dSYM",
  1248. ]
  1249. outputs = [
  1250. "{{bundle_executable_dir}}/${app_name}.dSYM",
  1251. ]
  1252. testonly = true
  1253. }
  1254. create_bundle("$app_name") {
  1255. product_type = "com.apple.product-type.application"
  1256. testonly = true
  1257. bundle_root_dir = "${root_build_dir}/${target_name}.app"
  1258. bundle_resources_dir = bundle_root_dir
  1259. bundle_executable_dir = bundle_root_dir
  1260. deps = [
  1261. ":${app_name}_bundle_executable",
  1262. ":${app_name}_bundle_info_plist",
  1263. ":${app_name}_bundle_resources",
  1264. ":${app_name}_bundle_symbols",
  1265. ]
  1266. if (has_skps) {
  1267. deps += [ ":${app_name}_bundle_skps" ]
  1268. }
  1269. # should only code sign when running on a device, not the simulator
  1270. if (target_cpu != "x64") {
  1271. code_signing_script = "//gn/codesign_ios.py"
  1272. code_signing_sources = [ "$target_gen_dir/$app_name" ]
  1273. code_signing_outputs = [
  1274. "$bundle_root_dir/_CodeSignature/CodeResources",
  1275. "$bundle_root_dir/embedded.mobileprovision",
  1276. ]
  1277. code_signing_args = [
  1278. rebase_path("$bundle_root_dir", root_build_dir),
  1279. skia_ios_identity,
  1280. skia_ios_profile,
  1281. ]
  1282. }
  1283. }
  1284. } else {
  1285. # !is_ios
  1286. if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
  1287. shared_library("lib" + target_name) {
  1288. forward_variables_from(invoker, "*", [ "is_shared_library" ])
  1289. configs += [ ":skia_private" ]
  1290. testonly = true
  1291. }
  1292. } else {
  1293. _executable = target_name
  1294. executable(_executable) {
  1295. check_includes = false
  1296. forward_variables_from(invoker, "*", [ "is_shared_library" ])
  1297. configs += [ ":skia_private" ]
  1298. testonly = true
  1299. }
  1300. }
  1301. if (is_android && skia_android_serial != "" && defined(_executable)) {
  1302. action("push_" + target_name) {
  1303. script = "gn/push_to_android.py"
  1304. deps = [
  1305. ":" + _executable,
  1306. ]
  1307. _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
  1308. outputs = [
  1309. _stamp,
  1310. ]
  1311. args = [
  1312. rebase_path("$root_build_dir/$_executable"),
  1313. skia_android_serial,
  1314. rebase_path(_stamp),
  1315. ]
  1316. testonly = true
  1317. }
  1318. }
  1319. }
  1320. }
  1321. config("moltenvk_config") {
  1322. if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
  1323. if (is_ios) {
  1324. moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
  1325. } else {
  1326. moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
  1327. }
  1328. cflags = [ "-F$moltenvk_framework_path" ]
  1329. ldflags = [ "-F$moltenvk_framework_path" ]
  1330. libs = [
  1331. "MoltenVK.framework",
  1332. "Metal.framework",
  1333. "IOSurface.framework",
  1334. "QuartzCore.framework",
  1335. "Foundation.framework",
  1336. ]
  1337. if (is_ios) {
  1338. libs += [ "UIKit.framework" ]
  1339. } else {
  1340. libs += [ "IOKit.framework" ]
  1341. }
  1342. defines = [ "SK_MOLTENVK" ]
  1343. }
  1344. }
  1345. source_set("moltenvk") {
  1346. public_configs = [ ":moltenvk_config" ]
  1347. }
  1348. test_lib("gpu_tool_utils") {
  1349. public_defines = []
  1350. # Bots and even devs may not have Vulkan headers, so put
  1351. # include/third_party/vulkan on our path so they're always available.
  1352. all_dependent_configs = [ ":our_vulkan_headers" ]
  1353. defines = []
  1354. if (skia_enable_discrete_gpu) {
  1355. defines += [ "SK_ENABLE_DISCRETE_GPU" ]
  1356. }
  1357. deps = []
  1358. public_deps = []
  1359. sources = [
  1360. "tools/gpu/GrContextFactory.cpp",
  1361. "tools/gpu/GrTest.cpp",
  1362. "tools/gpu/MemoryCache.cpp",
  1363. "tools/gpu/MemoryCache.h",
  1364. "tools/gpu/ProxyUtils.cpp",
  1365. "tools/gpu/TestContext.cpp",
  1366. "tools/gpu/YUVUtils.cpp",
  1367. "tools/gpu/YUVUtils.h",
  1368. "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
  1369. "tools/gpu/gl/GLTestContext.cpp",
  1370. "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
  1371. "tools/gpu/mock/MockTestContext.cpp",
  1372. ]
  1373. libs = []
  1374. if (is_android || is_linux || skia_use_egl) {
  1375. sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
  1376. } else if (is_ios) {
  1377. sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
  1378. libs += [ "OpenGLES.framework" ]
  1379. } else if (is_mac) {
  1380. sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
  1381. } else if (is_win) {
  1382. sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
  1383. libs += [ "Gdi32.lib" ]
  1384. if (target_cpu != "arm64") {
  1385. libs += [ "OpenGL32.lib" ]
  1386. }
  1387. }
  1388. cflags_objcc = [ "-fobjc-arc" ]
  1389. if (skia_use_angle) {
  1390. deps += [ "//third_party/angle2" ]
  1391. sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
  1392. }
  1393. if (skia_use_vulkan) {
  1394. sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
  1395. sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
  1396. if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
  1397. public_deps += [ ":moltenvk" ]
  1398. }
  1399. }
  1400. if (skia_use_metal) {
  1401. sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
  1402. }
  1403. if (skia_use_dawn) {
  1404. public_deps += [ "//third_party/dawn:dawn_headers" ]
  1405. sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
  1406. }
  1407. }
  1408. test_lib("flags") {
  1409. sources = [
  1410. "tools/flags/CommandLineFlags.cpp",
  1411. ]
  1412. }
  1413. test_lib("common_flags_config") {
  1414. sources = [
  1415. "tools/flags/CommonFlagsConfig.cpp",
  1416. ]
  1417. deps = [
  1418. ":flags",
  1419. ]
  1420. public_deps = [
  1421. ":gpu_tool_utils",
  1422. ]
  1423. }
  1424. test_lib("common_flags_gpu") {
  1425. sources = [
  1426. "tools/flags/CommonFlagsGpu.cpp",
  1427. ]
  1428. deps = [
  1429. ":flags",
  1430. ]
  1431. public_deps = [
  1432. ":gpu_tool_utils",
  1433. ]
  1434. }
  1435. test_lib("common_flags_images") {
  1436. sources = [
  1437. "tools/flags/CommonFlagsImages.cpp",
  1438. ]
  1439. deps = [
  1440. ":flags",
  1441. ]
  1442. }
  1443. test_lib("common_flags_aa") {
  1444. sources = [
  1445. "tools/flags/CommonFlagsAA.cpp",
  1446. ]
  1447. deps = [
  1448. ":flags",
  1449. ]
  1450. }
  1451. test_lib("trace") {
  1452. deps = [
  1453. ":flags",
  1454. ]
  1455. sources = [
  1456. "tools/trace/ChromeTracingTracer.cpp",
  1457. "tools/trace/ChromeTracingTracer.h",
  1458. "tools/trace/EventTracingPriv.cpp",
  1459. "tools/trace/EventTracingPriv.h",
  1460. "tools/trace/SkDebugfTracer.cpp",
  1461. "tools/trace/SkDebugfTracer.h",
  1462. ]
  1463. }
  1464. test_lib("tool_utils") {
  1465. sources = [
  1466. "tools/AndroidSkDebugToStdOut.cpp",
  1467. "tools/AutoreleasePool.h",
  1468. "tools/CrashHandler.cpp",
  1469. "tools/DDLPromiseImageHelper.cpp",
  1470. "tools/DDLTileHelper.cpp",
  1471. "tools/LsanSuppressions.cpp",
  1472. "tools/ProcStats.cpp",
  1473. "tools/Resources.cpp",
  1474. "tools/SkMetaData.cpp",
  1475. "tools/SkMetaData.h",
  1476. "tools/SkSharingProc.cpp",
  1477. "tools/ToolUtils.cpp",
  1478. "tools/UrlDataManager.cpp",
  1479. "tools/debugger/DebugCanvas.cpp",
  1480. "tools/debugger/DrawCommand.cpp",
  1481. "tools/debugger/JsonWriteBuffer.cpp",
  1482. "tools/fonts/RandomScalerContext.cpp",
  1483. "tools/fonts/TestEmptyTypeface.h",
  1484. "tools/fonts/TestFontMgr.cpp",
  1485. "tools/fonts/TestFontMgr.h",
  1486. "tools/fonts/TestSVGTypeface.cpp",
  1487. "tools/fonts/TestSVGTypeface.h",
  1488. "tools/fonts/TestTypeface.cpp",
  1489. "tools/fonts/TestTypeface.h",
  1490. "tools/fonts/ToolUtilsFont.cpp",
  1491. "tools/random_parse_path.cpp",
  1492. "tools/timer/TimeUtils.h",
  1493. "tools/timer/Timer.cpp",
  1494. ]
  1495. libs = []
  1496. if (is_ios) {
  1497. sources += [ "tools/ios_utils.m" ]
  1498. sources += [ "tools/ios_utils.h" ]
  1499. if (skia_use_metal) {
  1500. sources += [ "tools/AutoreleasePool.mm" ]
  1501. }
  1502. libs += [ "Foundation.framework" ]
  1503. } else if (is_mac) {
  1504. if (skia_use_metal) {
  1505. sources += [ "tools/AutoreleasePool.mm" ]
  1506. libs += [ "Foundation.framework" ]
  1507. }
  1508. } else if (is_win) {
  1509. libs += [ "DbgHelp.lib" ]
  1510. }
  1511. defines = []
  1512. if (skia_tools_require_resources) {
  1513. defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
  1514. }
  1515. deps = [
  1516. ":experimental_svg_model",
  1517. ":flags",
  1518. ]
  1519. public_deps = [
  1520. ":gpu_tool_utils",
  1521. ]
  1522. }
  1523. test_lib("etc1") {
  1524. sources = [
  1525. "third_party/etc1/etc1.cpp",
  1526. ]
  1527. }
  1528. if (skia_use_ffmpeg) {
  1529. test_lib("video_decoder") {
  1530. sources = [
  1531. "experimental/ffmpeg/SkVideoDecoder.cpp",
  1532. "experimental/ffmpeg/SkVideoDecoder.h",
  1533. "experimental/ffmpeg/SkVideoEncoder.cpp",
  1534. "experimental/ffmpeg/SkVideoEncoder.h",
  1535. ]
  1536. libs = [
  1537. "swscale",
  1538. "avcodec",
  1539. "avformat",
  1540. "avutil",
  1541. ]
  1542. }
  1543. }
  1544. import("gn/gm.gni")
  1545. test_lib("gm") {
  1546. sources = gm_sources
  1547. deps = [
  1548. ":etc1",
  1549. ":flags",
  1550. ":skia",
  1551. ":tool_utils",
  1552. "modules/skottie",
  1553. "modules/skottie:gm",
  1554. "modules/sksg",
  1555. "modules/skshaper",
  1556. ]
  1557. public_deps = [
  1558. ":gpu_tool_utils",
  1559. ]
  1560. if (skia_use_ffmpeg) {
  1561. deps += [ ":video_decoder" ]
  1562. sources += [ "gm/video_decoder.cpp" ]
  1563. }
  1564. }
  1565. test_lib("skvm_builders") {
  1566. sources = [
  1567. "tools/SkVMBuilders.cpp",
  1568. "tools/SkVMBuilders.h",
  1569. ]
  1570. }
  1571. import("gn/tests.gni")
  1572. test_lib("tests") {
  1573. sources = tests_sources + pathops_tests_sources
  1574. if (skia_use_metal) {
  1575. sources += metal_tests_sources
  1576. }
  1577. if (!skia_enable_fontmgr_android) {
  1578. sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
  1579. }
  1580. if (!(skia_use_freetype && skia_use_fontconfig)) {
  1581. sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
  1582. }
  1583. deps = [
  1584. ":experimental_svg_model",
  1585. ":flags",
  1586. ":skia",
  1587. ":skvm_builders",
  1588. ":tool_utils",
  1589. "modules/skottie:tests",
  1590. "modules/skparagraph:tests",
  1591. "modules/sksg:tests",
  1592. "modules/skshaper",
  1593. "//third_party/libpng",
  1594. "//third_party/libwebp",
  1595. "//third_party/zlib",
  1596. ]
  1597. public_deps = [
  1598. ":gpu_tool_utils", # Test.h #includes headers from this target.
  1599. ]
  1600. }
  1601. import("gn/bench.gni")
  1602. test_lib("bench") {
  1603. sources = bench_sources
  1604. deps = [
  1605. ":flags",
  1606. ":gm",
  1607. ":gpu_tool_utils",
  1608. ":skia",
  1609. ":skvm_builders",
  1610. ":tool_utils",
  1611. "modules/skparagraph:bench",
  1612. "modules/skshaper",
  1613. ]
  1614. }
  1615. test_lib("experimental_svg_model") {
  1616. if (skia_use_expat) {
  1617. sources = [
  1618. "experimental/svg/model/SkSVGAttribute.cpp",
  1619. "experimental/svg/model/SkSVGAttributeParser.cpp",
  1620. "experimental/svg/model/SkSVGCircle.cpp",
  1621. "experimental/svg/model/SkSVGClipPath.cpp",
  1622. "experimental/svg/model/SkSVGContainer.cpp",
  1623. "experimental/svg/model/SkSVGDOM.cpp",
  1624. "experimental/svg/model/SkSVGEllipse.cpp",
  1625. "experimental/svg/model/SkSVGGradient.cpp",
  1626. "experimental/svg/model/SkSVGLine.cpp",
  1627. "experimental/svg/model/SkSVGLinearGradient.cpp",
  1628. "experimental/svg/model/SkSVGNode.cpp",
  1629. "experimental/svg/model/SkSVGPath.cpp",
  1630. "experimental/svg/model/SkSVGPattern.cpp",
  1631. "experimental/svg/model/SkSVGPoly.cpp",
  1632. "experimental/svg/model/SkSVGRadialGradient.cpp",
  1633. "experimental/svg/model/SkSVGRect.cpp",
  1634. "experimental/svg/model/SkSVGRenderContext.cpp",
  1635. "experimental/svg/model/SkSVGSVG.cpp",
  1636. "experimental/svg/model/SkSVGShape.cpp",
  1637. "experimental/svg/model/SkSVGStop.cpp",
  1638. "experimental/svg/model/SkSVGTransformableNode.cpp",
  1639. "experimental/svg/model/SkSVGUse.cpp",
  1640. "experimental/svg/model/SkSVGValue.cpp",
  1641. ]
  1642. deps = [
  1643. ":skia",
  1644. ":xml",
  1645. ]
  1646. }
  1647. }
  1648. test_lib("experimental_xform") {
  1649. sources = [
  1650. "experimental/xform/SkShape.cpp",
  1651. "experimental/xform/SkXform.cpp",
  1652. "experimental/xform/XContext.cpp",
  1653. ]
  1654. deps = [
  1655. ":skia",
  1656. ]
  1657. }
  1658. if (skia_use_lua) {
  1659. test_lib("lua") {
  1660. sources = [
  1661. "src/utils/SkLua.cpp",
  1662. "src/utils/SkLuaCanvas.cpp",
  1663. ]
  1664. deps = [
  1665. "modules/skshaper",
  1666. "//third_party/lua",
  1667. ]
  1668. }
  1669. test_app("lua_app") {
  1670. sources = [
  1671. "tools/lua/lua_app.cpp",
  1672. ]
  1673. deps = [
  1674. ":lua",
  1675. ":skia",
  1676. "//third_party/lua",
  1677. ]
  1678. }
  1679. test_app("lua_pictures") {
  1680. sources = [
  1681. "tools/lua/lua_pictures.cpp",
  1682. ]
  1683. deps = [
  1684. ":flags",
  1685. ":lua",
  1686. ":skia",
  1687. ":tool_utils",
  1688. "//third_party/lua",
  1689. ]
  1690. }
  1691. }
  1692. if (is_linux || is_mac) {
  1693. test_app("skottie_tool") {
  1694. deps = [
  1695. "modules/skottie:tool",
  1696. ]
  1697. }
  1698. }
  1699. test_app("make_skqp_model") {
  1700. sources = [
  1701. "tools/skqp/make_skqp_model.cpp",
  1702. ]
  1703. deps = [
  1704. ":skia",
  1705. ]
  1706. }
  1707. if (target_cpu != "wasm") {
  1708. import("gn/samples.gni")
  1709. test_lib("samples") {
  1710. sources = samples_sources
  1711. public_deps = [
  1712. ":tool_utils",
  1713. ]
  1714. deps = [
  1715. ":experimental_svg_model",
  1716. ":flags",
  1717. ":gpu_tool_utils",
  1718. ":xml",
  1719. "modules/skparagraph:samples",
  1720. "modules/sksg",
  1721. "modules/skshaper",
  1722. ]
  1723. if (skia_use_lua) {
  1724. sources += [ "samplecode/SampleLua.cpp" ]
  1725. deps += [
  1726. ":lua",
  1727. "//third_party/lua",
  1728. ]
  1729. }
  1730. }
  1731. test_app("imgcvt") {
  1732. sources = [
  1733. "tools/imgcvt.cpp",
  1734. ]
  1735. deps = [
  1736. ":skcms",
  1737. ":skia",
  1738. ]
  1739. }
  1740. test_lib("hash_and_encode") {
  1741. sources = [
  1742. "tools/HashAndEncode.cpp",
  1743. "tools/HashAndEncode.h",
  1744. ]
  1745. deps = [
  1746. ":flags",
  1747. ":skia",
  1748. "//third_party/libpng",
  1749. ]
  1750. }
  1751. test_app("fm") {
  1752. sources = [
  1753. "tools/fm/fm.cpp",
  1754. ]
  1755. deps = [
  1756. ":common_flags_aa",
  1757. ":common_flags_gpu",
  1758. ":experimental_svg_model",
  1759. ":flags",
  1760. ":gm",
  1761. ":gpu_tool_utils",
  1762. ":hash_and_encode",
  1763. ":skia",
  1764. ":tool_utils",
  1765. ":trace",
  1766. "modules/skottie",
  1767. "modules/skottie:utils",
  1768. ]
  1769. }
  1770. test_app("dm") {
  1771. sources = [
  1772. "dm/DM.cpp",
  1773. "dm/DMGpuTestProcs.cpp",
  1774. "dm/DMJsonWriter.cpp",
  1775. "dm/DMSrcSink.cpp",
  1776. ]
  1777. deps = [
  1778. ":common_flags_aa",
  1779. ":common_flags_config",
  1780. ":common_flags_gpu",
  1781. ":common_flags_images",
  1782. ":experimental_svg_model",
  1783. ":flags",
  1784. ":gm",
  1785. ":gpu_tool_utils",
  1786. ":hash_and_encode",
  1787. ":skia",
  1788. ":tests",
  1789. ":tool_utils",
  1790. ":trace",
  1791. "modules/skottie",
  1792. "modules/skottie:utils",
  1793. "modules/sksg",
  1794. ]
  1795. }
  1796. }
  1797. if (!is_win) {
  1798. test_app("remote_demo") {
  1799. sources = [
  1800. "tools/remote_demo.cpp",
  1801. ]
  1802. deps = [
  1803. ":skia",
  1804. ]
  1805. }
  1806. }
  1807. test_app("nanobench") {
  1808. sources = [
  1809. "bench/nanobench.cpp",
  1810. ]
  1811. deps = [
  1812. ":bench",
  1813. ":common_flags_aa",
  1814. ":common_flags_config",
  1815. ":common_flags_gpu",
  1816. ":common_flags_images",
  1817. ":experimental_svg_model",
  1818. ":flags",
  1819. ":gm",
  1820. ":gpu_tool_utils",
  1821. ":skia",
  1822. ":tool_utils",
  1823. ":trace",
  1824. "modules/skparagraph:bench",
  1825. "modules/sksg",
  1826. "modules/skshaper",
  1827. ]
  1828. }
  1829. test_app("skpinfo") {
  1830. sources = [
  1831. "tools/skpinfo.cpp",
  1832. ]
  1833. deps = [
  1834. ":flags",
  1835. ":skia",
  1836. ]
  1837. }
  1838. if (skia_use_ffmpeg) {
  1839. test_app("skottie2movie") {
  1840. sources = [
  1841. "tools/skottie2movie.cpp",
  1842. ]
  1843. deps = [
  1844. ":flags",
  1845. ":skia",
  1846. ":video_decoder",
  1847. "modules/skottie",
  1848. "modules/skottie:utils",
  1849. ]
  1850. }
  1851. }
  1852. test_app("skpbench") {
  1853. sources = [
  1854. "tools/skpbench/skpbench.cpp",
  1855. ]
  1856. deps = [
  1857. ":common_flags_config",
  1858. ":common_flags_gpu",
  1859. ":flags",
  1860. ":gpu_tool_utils",
  1861. ":skia",
  1862. ":tool_utils",
  1863. ]
  1864. }
  1865. test_app("sktexttopdf") {
  1866. sources = [
  1867. "tools/using_skia_and_harfbuzz.cpp",
  1868. ]
  1869. deps = [
  1870. ":skia",
  1871. "modules/skshaper",
  1872. ]
  1873. }
  1874. test_app("create_test_font") {
  1875. sources = [
  1876. "tools/fonts/create_test_font.cpp",
  1877. ]
  1878. deps = [
  1879. ":skia",
  1880. ]
  1881. assert_no_deps = [
  1882. # tool_utils requires the output of this app.
  1883. ":tool_utils",
  1884. ]
  1885. }
  1886. if (skia_use_expat) {
  1887. test_app("create_test_font_color") {
  1888. sources = [
  1889. "tools/fonts/create_test_font_color.cpp",
  1890. ]
  1891. deps = [
  1892. ":flags",
  1893. ":skia",
  1894. ":tool_utils",
  1895. ]
  1896. }
  1897. }
  1898. test_app("get_images_from_skps") {
  1899. sources = [
  1900. "tools/get_images_from_skps.cpp",
  1901. ]
  1902. deps = [
  1903. ":flags",
  1904. ":skia",
  1905. ]
  1906. }
  1907. if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
  1908. test_app("skiaserve") {
  1909. sources = [
  1910. "tools/skiaserve/Request.cpp",
  1911. "tools/skiaserve/Response.cpp",
  1912. "tools/skiaserve/skiaserve.cpp",
  1913. "tools/skiaserve/urlhandlers/BreakHandler.cpp",
  1914. "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
  1915. "tools/skiaserve/urlhandlers/CmdHandler.cpp",
  1916. "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
  1917. "tools/skiaserve/urlhandlers/DataHandler.cpp",
  1918. "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
  1919. "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
  1920. "tools/skiaserve/urlhandlers/ImgHandler.cpp",
  1921. "tools/skiaserve/urlhandlers/InfoHandler.cpp",
  1922. "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
  1923. "tools/skiaserve/urlhandlers/OpsHandler.cpp",
  1924. "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
  1925. "tools/skiaserve/urlhandlers/PostHandler.cpp",
  1926. "tools/skiaserve/urlhandlers/QuitHandler.cpp",
  1927. "tools/skiaserve/urlhandlers/RootHandler.cpp",
  1928. ]
  1929. deps = [
  1930. ":flags",
  1931. ":gpu_tool_utils",
  1932. ":skia",
  1933. ":tool_utils",
  1934. "//third_party/libmicrohttpd",
  1935. ]
  1936. }
  1937. }
  1938. test_app("fuzz") {
  1939. sources = [
  1940. "fuzz/Fuzz.cpp",
  1941. "fuzz/FuzzCanvas.cpp",
  1942. "fuzz/FuzzCommon.cpp",
  1943. "fuzz/FuzzDrawFunctions.cpp",
  1944. "fuzz/FuzzEncoders.cpp",
  1945. "fuzz/FuzzGradients.cpp",
  1946. "fuzz/FuzzMain.cpp",
  1947. "fuzz/FuzzParsePath.cpp",
  1948. "fuzz/FuzzPathMeasure.cpp",
  1949. "fuzz/FuzzPathop.cpp",
  1950. "fuzz/FuzzPolyUtils.cpp",
  1951. "fuzz/FuzzRegionOp.cpp",
  1952. "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
  1953. "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
  1954. "fuzz/oss_fuzz/FuzzImage.cpp",
  1955. "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
  1956. "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
  1957. "fuzz/oss_fuzz/FuzzJSON.cpp",
  1958. "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
  1959. "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
  1960. "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
  1961. "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
  1962. "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
  1963. "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
  1964. "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
  1965. "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
  1966. "tools/UrlDataManager.cpp",
  1967. "tools/debugger/DebugCanvas.cpp",
  1968. "tools/debugger/DrawCommand.cpp",
  1969. "tools/debugger/JsonWriteBuffer.cpp",
  1970. ]
  1971. deps = [
  1972. ":flags",
  1973. ":gpu_tool_utils",
  1974. ":skia",
  1975. "modules/skottie:fuzz",
  1976. ]
  1977. }
  1978. test_app("pathops_unittest") {
  1979. sources = pathops_tests_sources + [
  1980. rebase_path("tests/skia_test.cpp"),
  1981. rebase_path("tests/Test.cpp"),
  1982. ]
  1983. deps = [
  1984. ":flags",
  1985. ":gpu_tool_utils",
  1986. ":skia",
  1987. ":tool_utils",
  1988. ]
  1989. }
  1990. test_app("dump_record") {
  1991. sources = [
  1992. "tools/DumpRecord.cpp",
  1993. "tools/dump_record.cpp",
  1994. ]
  1995. deps = [
  1996. ":flags",
  1997. ":skia",
  1998. ]
  1999. }
  2000. test_app("skdiff") {
  2001. sources = [
  2002. "tools/skdiff/skdiff.cpp",
  2003. "tools/skdiff/skdiff_html.cpp",
  2004. "tools/skdiff/skdiff_main.cpp",
  2005. "tools/skdiff/skdiff_utils.cpp",
  2006. ]
  2007. deps = [
  2008. ":skia",
  2009. ":tool_utils",
  2010. ]
  2011. }
  2012. test_app("skp_parser") {
  2013. sources = [
  2014. "tools/skp_parser.cpp",
  2015. ]
  2016. deps = [
  2017. ":skia",
  2018. ":tool_utils",
  2019. ]
  2020. }
  2021. if (!is_win) {
  2022. test_lib("skqp_lib") {
  2023. defines =
  2024. [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
  2025. sources = [
  2026. "dm/DMGpuTestProcs.cpp",
  2027. "tools/skqp/src/skqp.cpp",
  2028. "tools/skqp/src/skqp_model.cpp",
  2029. ]
  2030. deps = [
  2031. ":gm",
  2032. ":gpu_tool_utils",
  2033. ":skia",
  2034. ":tests",
  2035. ":tool_utils",
  2036. ]
  2037. }
  2038. test_app("skqp") {
  2039. sources = [
  2040. "tools/skqp/src/skqp_main.cpp",
  2041. ]
  2042. deps = [
  2043. ":skia",
  2044. ":skqp_lib",
  2045. ":tool_utils",
  2046. ]
  2047. }
  2048. test_app("jitter_gms") {
  2049. sources = [
  2050. "tools/skqp/jitter_gms.cpp",
  2051. ]
  2052. deps = [
  2053. ":gm",
  2054. ":skia",
  2055. ":skqp_lib",
  2056. ]
  2057. }
  2058. }
  2059. if (is_android) {
  2060. test_app("skqp_app") {
  2061. is_shared_library = true
  2062. sources = [
  2063. "tools/skqp/src/jni_skqp.cpp",
  2064. ]
  2065. deps = [
  2066. ":skia",
  2067. ":skqp_lib",
  2068. ":tool_utils",
  2069. ]
  2070. libs = [ "android" ]
  2071. }
  2072. }
  2073. if (is_android && skia_enable_gpu) {
  2074. test_app("skottie_android") {
  2075. is_shared_library = true
  2076. sources = [
  2077. "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
  2078. "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
  2079. ]
  2080. libs = []
  2081. deps = [
  2082. ":skia",
  2083. "modules/skottie",
  2084. "modules/sksg:samples",
  2085. ]
  2086. }
  2087. }
  2088. test_app("list_gms") {
  2089. sources = [
  2090. "tools/list_gms.cpp",
  2091. ]
  2092. deps = [
  2093. ":gm",
  2094. ":skia",
  2095. ]
  2096. }
  2097. test_app("list_gpu_unit_tests") {
  2098. sources = [
  2099. "dm/DMGpuTestProcs.cpp",
  2100. "tools/list_gpu_unit_tests.cpp",
  2101. ]
  2102. deps = [
  2103. ":skia",
  2104. ":tests",
  2105. ]
  2106. }
  2107. test_lib("sk_app") {
  2108. public_deps = [
  2109. ":gpu_tool_utils",
  2110. ":skia",
  2111. ]
  2112. sources = [
  2113. "tools/sk_app/CommandSet.cpp",
  2114. "tools/sk_app/GLWindowContext.cpp",
  2115. "tools/sk_app/Window.cpp",
  2116. ]
  2117. libs = []
  2118. if (is_android) {
  2119. sources += [
  2120. "tools/sk_app/android/GLWindowContext_android.cpp",
  2121. "tools/sk_app/android/RasterWindowContext_android.cpp",
  2122. "tools/sk_app/android/Window_android.cpp",
  2123. "tools/sk_app/android/main_android.cpp",
  2124. "tools/sk_app/android/surface_glue_android.cpp",
  2125. ]
  2126. libs += [ "android" ]
  2127. } else if (is_linux) {
  2128. sources += [
  2129. "tools/sk_app/unix/GLWindowContext_unix.cpp",
  2130. "tools/sk_app/unix/RasterWindowContext_unix.cpp",
  2131. "tools/sk_app/unix/Window_unix.cpp",
  2132. "tools/sk_app/unix/keysym2ucs.c",
  2133. "tools/sk_app/unix/main_unix.cpp",
  2134. ]
  2135. libs += [
  2136. "GL",
  2137. "X11",
  2138. ]
  2139. } else if (is_win) {
  2140. sources += [
  2141. "tools/sk_app/win/GLWindowContext_win.cpp",
  2142. "tools/sk_app/win/RasterWindowContext_win.cpp",
  2143. "tools/sk_app/win/Window_win.cpp",
  2144. "tools/sk_app/win/main_win.cpp",
  2145. ]
  2146. if (skia_use_angle) {
  2147. sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
  2148. }
  2149. } else if (is_mac) {
  2150. sources += [
  2151. "tools/sk_app/mac/GLWindowContext_mac.mm",
  2152. "tools/sk_app/mac/RasterWindowContext_mac.mm",
  2153. "tools/sk_app/mac/Window_mac.mm",
  2154. "tools/sk_app/mac/main_mac.mm",
  2155. ]
  2156. libs += [
  2157. "QuartzCore.framework",
  2158. "Cocoa.framework",
  2159. "Foundation.framework",
  2160. ]
  2161. } else if (is_ios) {
  2162. sources += [
  2163. "tools/sk_app/ios/GLWindowContext_ios.cpp",
  2164. "tools/sk_app/ios/RasterWindowContext_ios.cpp",
  2165. "tools/sk_app/ios/Window_ios.cpp",
  2166. "tools/sk_app/ios/main_ios.cpp",
  2167. ]
  2168. }
  2169. if (skia_use_vulkan) {
  2170. sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
  2171. if (is_android) {
  2172. sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
  2173. } else if (is_linux) {
  2174. sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
  2175. libs += [ "X11-xcb" ]
  2176. } else if (is_win) {
  2177. sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
  2178. } else if (is_mac) {
  2179. sources += [ "tools/sk_app/mac/VulkanWindowContext_mac.mm" ]
  2180. libs += [ "MetalKit.framework" ]
  2181. }
  2182. }
  2183. if (skia_use_metal) {
  2184. sources += [ "tools/sk_app/MetalWindowContext.mm" ]
  2185. if (is_mac) {
  2186. sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
  2187. }
  2188. libs += [ "MetalKit.framework" ]
  2189. }
  2190. deps = [
  2191. ":tool_utils",
  2192. ]
  2193. if (is_android) {
  2194. deps += [ "//third_party/native_app_glue" ]
  2195. } else if (is_ios) {
  2196. deps += [ "//third_party/libsdl" ]
  2197. }
  2198. if (skia_use_angle) {
  2199. deps += [ "//third_party/angle2" ]
  2200. }
  2201. }
  2202. if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
  2203. test_app("fiddle_examples") {
  2204. sources = [
  2205. "tools/fiddle/all_examples.cpp",
  2206. "tools/fiddle/examples.cpp",
  2207. "tools/fiddle/examples.h",
  2208. ]
  2209. if (is_win) {
  2210. cflags = [ "/wd4756" ] # Overflow in constant arithmetic
  2211. }
  2212. deps = [
  2213. ":skia",
  2214. ":skia.h",
  2215. "modules/skottie",
  2216. "modules/skshaper",
  2217. ]
  2218. }
  2219. }
  2220. test_app("viewer") {
  2221. is_shared_library = is_android
  2222. sources = [
  2223. "tools/viewer/AnimTimer.h",
  2224. "tools/viewer/BisectSlide.cpp",
  2225. "tools/viewer/GMSlide.cpp",
  2226. "tools/viewer/ImGuiLayer.cpp",
  2227. "tools/viewer/ImageSlide.cpp",
  2228. "tools/viewer/ParticlesSlide.cpp",
  2229. "tools/viewer/SKPSlide.cpp",
  2230. "tools/viewer/SampleSlide.cpp",
  2231. "tools/viewer/SkottieSlide.cpp",
  2232. "tools/viewer/SlideDir.cpp",
  2233. "tools/viewer/StatsLayer.cpp",
  2234. "tools/viewer/SvgSlide.cpp",
  2235. "tools/viewer/TouchGesture.cpp",
  2236. "tools/viewer/TouchGesture.h",
  2237. "tools/viewer/Viewer.cpp",
  2238. ]
  2239. libs = []
  2240. deps = [
  2241. ":common_flags_gpu",
  2242. ":experimental_svg_model",
  2243. ":flags",
  2244. ":gm",
  2245. ":gpu_tool_utils",
  2246. ":samples",
  2247. ":sk_app",
  2248. ":skia",
  2249. ":tool_utils",
  2250. ":trace",
  2251. "modules/particles",
  2252. "modules/skottie",
  2253. "modules/skottie:utils",
  2254. "modules/sksg",
  2255. "modules/sksg:samples",
  2256. "//third_party/imgui",
  2257. ]
  2258. if (skia_use_experimental_xform) {
  2259. deps += [ ":experimental_xform" ]
  2260. sources += [ "gm/xform.cpp" ]
  2261. }
  2262. }
  2263. if (!skia_use_angle && (is_linux || is_win || is_mac)) {
  2264. test_app("HelloWorld") {
  2265. sources = [
  2266. "example/HelloWorld.cpp",
  2267. ]
  2268. libs = []
  2269. deps = [
  2270. ":flags",
  2271. ":gpu_tool_utils",
  2272. ":sk_app",
  2273. ":skia",
  2274. ":tool_utils",
  2275. ]
  2276. }
  2277. }
  2278. if (is_linux || is_mac || is_ios) {
  2279. test_app("SkiaSDLExample") {
  2280. sources = [
  2281. "example/SkiaSDLExample.cpp",
  2282. ]
  2283. libs = []
  2284. deps = [
  2285. ":gpu_tool_utils",
  2286. ":skia",
  2287. "//third_party/libsdl",
  2288. ]
  2289. }
  2290. }
  2291. if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
  2292. action_foreach("generate_mocs") {
  2293. script = "gn/call.py"
  2294. sources = [
  2295. "tools/mdbviz/MainWindow.h",
  2296. ]
  2297. outputs = [
  2298. "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
  2299. ]
  2300. args = [
  2301. "$skia_qt_path" + "/bin/moc",
  2302. "{{source}}",
  2303. "-o",
  2304. "gen/mdbviz/{{source_name_part}}_moc.cpp",
  2305. ]
  2306. }
  2307. action_foreach("generate_resources") {
  2308. script = "gn/call.py"
  2309. sources = [
  2310. "tools/mdbviz/resources.qrc",
  2311. ]
  2312. outputs = [
  2313. "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
  2314. ]
  2315. args = [
  2316. "$skia_qt_path" + "/bin/rcc",
  2317. "{{source}}",
  2318. "-o",
  2319. "gen/mdbviz/{{source_name_part}}_res.cpp",
  2320. ]
  2321. }
  2322. test_app("mdbviz") {
  2323. if (is_win) {
  2324. # on Windows we need to disable some exception handling warnings due to the Qt headers
  2325. cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
  2326. }
  2327. sources = [
  2328. "tools/UrlDataManager.cpp",
  2329. "tools/debugger/DebugCanvas.cpp",
  2330. "tools/debugger/DrawCommand.cpp",
  2331. "tools/debugger/JsonWriteBuffer.cpp",
  2332. "tools/mdbviz/MainWindow.cpp",
  2333. "tools/mdbviz/Model.cpp",
  2334. "tools/mdbviz/main.cpp",
  2335. # generated files
  2336. "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
  2337. "$target_gen_dir/mdbviz/resources_res.cpp",
  2338. ]
  2339. lib_dirs = [ "$skia_qt_path/lib" ]
  2340. libs = [
  2341. "Qt5Core.lib",
  2342. "Qt5Gui.lib",
  2343. "Qt5Widgets.lib",
  2344. ]
  2345. include_dirs = [
  2346. "$skia_qt_path/include",
  2347. "$skia_qt_path/include/QtCore",
  2348. "$skia_qt_path/include/QtWidgets",
  2349. ]
  2350. deps = [
  2351. ":generate_mocs",
  2352. ":generate_resources",
  2353. ":skia",
  2354. ]
  2355. }
  2356. }
  2357. if (is_android && defined(ndk) && ndk != "") {
  2358. copy("gdbserver") {
  2359. sources = [
  2360. "$ndk/$ndk_gdbserver",
  2361. ]
  2362. outputs = [
  2363. "$root_out_dir/gdbserver",
  2364. ]
  2365. }
  2366. }
  2367. if (skia_use_opencl) {
  2368. test_app("hello-opencl") {
  2369. sources = [
  2370. "tools/hello-opencl.cpp",
  2371. ]
  2372. deps = [
  2373. "//third_party/opencl",
  2374. ]
  2375. }
  2376. }
  2377. executable("cpu_modules") {
  2378. sources = [
  2379. "tools/cpu_modules.cpp",
  2380. ]
  2381. deps = [
  2382. ":skia",
  2383. "modules/particles",
  2384. ]
  2385. }
  2386. test_app("editor") {
  2387. is_shared_library = is_android
  2388. sources = [
  2389. "experimental/editor/editor.cpp",
  2390. "experimental/editor/editor.h",
  2391. "experimental/editor/editor_application.cpp",
  2392. "experimental/editor/run_handler.cpp",
  2393. "experimental/editor/run_handler.h",
  2394. "experimental/editor/stringslice.cpp",
  2395. "experimental/editor/stringslice.h",
  2396. ]
  2397. deps = [
  2398. ":sk_app",
  2399. ":skia",
  2400. "modules/skshaper",
  2401. ]
  2402. }
  2403. if (skia_enable_skvm_jit) {
  2404. test_app("skvmtool") {
  2405. defines = [
  2406. "SKVM_JIT",
  2407. "SKVM_PERF_DUMPS",
  2408. ]
  2409. include_dirs = [ "." ]
  2410. sources = [
  2411. "src/core/SkSpinlock.cpp",
  2412. "src/core/SkThreadID.cpp",
  2413. "src/core/SkVM.cpp",
  2414. "tools/SkVMBuilders.cpp",
  2415. "tools/SkVMTool.cpp",
  2416. ]
  2417. if (target_cpu == "x64") {
  2418. sources += [ "src/core/SkCpu.cpp" ]
  2419. }
  2420. }
  2421. }
  2422. }