blob: 1415198d7641e2d559844749f46da7b174668d2a [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
config("cairo_config") {
include_dirs = [ "$target_gen_dir" ]
defines = [ "CAIRO_HAS_FC_FONT=0" ]
}
config("cairo_private_config") {
visibility = [ ":*" ]
cflags = [
"-Winit-self",
"-Winline",
"-Wmissing-declarations",
"-Wmissing-format-attribute",
"-Wno-attributes",
"-Wno-long-long",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
"-Wp,-D_FORTIFY_SOURCE=2",
"-Wpacked",
"-Wpointer-arith",
"-Wsign-compare",
"-Wstrict-aliasing=2",
"-Wswitch-enum",
"-Wvolatile-register-var",
"-Wwrite-strings",
"-Wno-ignored-attributes",
"-Wno-enum-conversion",
"-Wno-unused-function",
"-Wno-unused-variable",
"-Wno-parentheses-equality",
"-fno-common",
"-fno-strict-aliasing",
]
include_dirs = [ "." ]
}
copy("cairo_install_headers") {
visibility = [ ":*" ]
# From am__cairoinclude_HEADERS_DIST in src/Makefile from the cairo autoconf build,
# plus src/cairo-features.h which we check in.
# The most important part of this target is installing the real cairo-version.h from the root of
# the repository into a flag namespace. The cairo repository has src/cairo-version.h for internal
# reasons, but this header can't be used by consumers of the cairo library.
sources = [
"cairo-version.h",
"src/cairo-beos.h",
"src/cairo-cogl.h",
"src/cairo-deprecated.h",
"src/cairo-directfb.h",
"src/cairo-drm.h",
"src/cairo-features.h",
"src/cairo-ft.h",
"src/cairo-gl.h",
"src/cairo-os2.h",
"src/cairo-pdf.h",
"src/cairo-ps.h",
"src/cairo-qt.h",
"src/cairo-quartz-image.h",
"src/cairo-quartz.h",
"src/cairo-script.h",
"src/cairo-skia.h",
"src/cairo-svg.h",
"src/cairo-tee.h",
"src/cairo-vg.h",
"src/cairo-win32.h",
"src/cairo-xcb.h",
"src/cairo-xlib-xrender.h",
"src/cairo-xlib.h",
"src/cairo-xml.h",
"src/cairo.h",
]
outputs = [
"$target_gen_dir/{{source_file_part}}",
]
}
shared_library("cairo") {
sources = [
"src/cairo-analysis-surface.c",
"src/cairo-arc.c",
"src/cairo-array.c",
"src/cairo-atomic.c",
"src/cairo-base64-stream.c",
"src/cairo-base85-stream.c",
"src/cairo-bentley-ottmann-rectangular.c",
"src/cairo-bentley-ottmann-rectilinear.c",
"src/cairo-bentley-ottmann.c",
"src/cairo-botor-scan-converter.c",
"src/cairo-boxes-intersect.c",
"src/cairo-boxes.c",
"src/cairo-cache.c",
"src/cairo-cff-subset.c",
"src/cairo-clip-boxes.c",
"src/cairo-clip-polygon.c",
"src/cairo-clip-region.c",
"src/cairo-clip-surface.c",
"src/cairo-clip-tor-scan-converter.c",
"src/cairo-clip.c",
"src/cairo-color.c",
"src/cairo-composite-rectangles.c",
"src/cairo-compositor.c",
"src/cairo-contour.c",
"src/cairo-damage.c",
"src/cairo-debug.c",
"src/cairo-default-context.c",
"src/cairo-deflate-stream.c",
"src/cairo-device.c",
"src/cairo-error.c",
"src/cairo-fallback-compositor.c",
"src/cairo-fixed.c",
"src/cairo-font-face-twin-data.c",
"src/cairo-font-face-twin.c",
"src/cairo-font-face.c",
"src/cairo-font-options.c",
"src/cairo-freed-pool.c",
"src/cairo-freelist.c",
"src/cairo-ft-font.c",
"src/cairo-gstate.c",
"src/cairo-hash.c",
"src/cairo-hull.c",
"src/cairo-image-compositor.c",
"src/cairo-image-info.c",
"src/cairo-image-source.c",
"src/cairo-image-surface.c",
"src/cairo-line.c",
"src/cairo-lzw.c",
"src/cairo-mask-compositor.c",
"src/cairo-matrix.c",
"src/cairo-mempool.c",
"src/cairo-mesh-pattern-rasterizer.c",
"src/cairo-misc.c",
"src/cairo-mono-scan-converter.c",
"src/cairo-mutex.c",
"src/cairo-no-compositor.c",
"src/cairo-observer.c",
"src/cairo-output-stream.c",
"src/cairo-paginated-surface.c",
"src/cairo-path-bounds.c",
"src/cairo-path-fill.c",
"src/cairo-path-fixed.c",
"src/cairo-path-in-fill.c",
"src/cairo-path-stroke-boxes.c",
"src/cairo-path-stroke-polygon.c",
"src/cairo-path-stroke-traps.c",
"src/cairo-path-stroke-tristrip.c",
"src/cairo-path-stroke.c",
"src/cairo-path.c",
"src/cairo-pattern.c",
"src/cairo-pdf-operators.c",
"src/cairo-pdf-shading.c",
"src/cairo-pen.c",
"src/cairo-png.c",
"src/cairo-polygon-intersect.c",
"src/cairo-polygon-reduce.c",
"src/cairo-polygon.c",
"src/cairo-raster-source-pattern.c",
"src/cairo-recording-surface.c",
"src/cairo-rectangle.c",
"src/cairo-rectangular-scan-converter.c",
"src/cairo-region.c",
"src/cairo-rtree.c",
"src/cairo-scaled-font-subsets.c",
"src/cairo-scaled-font.c",
"src/cairo-shape-mask-compositor.c",
"src/cairo-slope.c",
"src/cairo-spans-compositor.c",
"src/cairo-spans.c",
"src/cairo-spline.c",
"src/cairo-stroke-dash.c",
"src/cairo-stroke-style.c",
"src/cairo-surface-clipper.c",
"src/cairo-surface-fallback.c",
"src/cairo-surface-observer.c",
"src/cairo-surface-offset.c",
"src/cairo-surface-snapshot.c",
"src/cairo-surface-subsurface.c",
"src/cairo-surface-wrapper.c",
"src/cairo-surface.c",
"src/cairo-time.c",
"src/cairo-tor-scan-converter.c",
"src/cairo-tor22-scan-converter.c",
"src/cairo-toy-font-face.c",
"src/cairo-traps-compositor.c",
"src/cairo-traps.c",
"src/cairo-tristrip.c",
"src/cairo-truetype-subset.c",
"src/cairo-type1-fallback.c",
"src/cairo-type1-glyph-names.c",
"src/cairo-type1-subset.c",
"src/cairo-type3-glyph-surface.c",
"src/cairo-unicode.c",
"src/cairo-user-font.c",
"src/cairo-version.c",
"src/cairo-wideint.c",
"src/cairo.c",
]
configs += [ ":cairo_private_config" ]
# The Cairo library authors are careful to hide private symbols explicitly,
# so default symbol visiblity is correct and neccesary for this library
# to work correct.
configs -= [ "//build/config:symbol_visibility_hidden" ]
defines = [
"HAVE_CONFIG_H",
"_REENTRANT",
]
deps = [
"//third_party/freetype2",
"//third_party/libpng",
"//third_party/pixman",
]
public_configs = [ ":cairo_config" ]
public_deps = [ ":cairo_install_headers" ]
}