diff --git a/BUILD.gn b/BUILD.gn index 14173a08c8..ede8fc49c9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1674,15 +1674,17 @@ if (skia_enable_tools) { ] } - test_app("create_test_font_color") { - sources = [ - "tools/fonts/create_test_font_color.cpp", - ] - deps = [ - ":flags", - ":skia", - ":tool_utils", - ] + if (skia_use_expat) { + test_app("create_test_font_color") { + sources = [ + "tools/fonts/create_test_font_color.cpp", + ] + deps = [ + ":flags", + ":skia", + ":tool_utils", + ] + } } test_app("get_images_from_skps") { diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp index 55fbc00980..8084ca9c17 100644 --- a/tools/skpbench/skpbench.cpp +++ b/tools/skpbench/skpbench.cpp @@ -533,6 +533,7 @@ static sk_sp create_skp_from_svg(SkStream* stream, const char* filena return recorder.finishRecordingAsPicture(); #endif exitf(ExitErr::kData, "SK_XML is disabled; cannot open svg file %s", filename); + return nullptr; } bool mkdir_p(const SkString& dirname) { diff --git a/tools/viewer/SvgSlide.cpp b/tools/viewer/SvgSlide.cpp index 41dc3187a5..9ea9e40395 100644 --- a/tools/viewer/SvgSlide.cpp +++ b/tools/viewer/SvgSlide.cpp @@ -7,6 +7,8 @@ #include "SvgSlide.h" +#if defined(SK_XML) + #include "SkCanvas.h" #include "SkStream.h" #include "SkSVGDOM.h" @@ -41,3 +43,5 @@ void SvgSlide::draw(SkCanvas* canvas) { fDom->render(canvas); } } + +#endif // SK_XML diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index 94db6f79ea..17277fc55d 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp @@ -530,10 +530,12 @@ void Viewer::initSlides() { return sk_make_sp(name, path);} }, #endif +#if defined(SK_XML) { ".svg", "svg-dir", FLAGS_svgs, [](const SkString& name, const SkString& path) -> sk_sp { return sk_make_sp(name, path);} }, +#endif #if !(defined(SK_BUILD_FOR_WIN) && defined(__clang__)) { ".nima", "nima-dir", FLAGS_nimas, [](const SkString& name, const SkString& path) -> sk_sp {