blob: 14f0c186a8cefb701ac083b1daf08b819ee55515 [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.
# This configuration is for consumers of the pixman library
config("pixman_config") {
include_dirs = [
"pixman",
"$target_gen_dir/pixman-version",
]
}
# Group containing the configs and deps for building the pixman library.
group("pixman_private") {
visibility = [ ":*" ]
public_configs = [ ":pixman_private_config" ]
public_deps = [
":pixman_config_h",
":pixman_version_h",
]
}
# The configuration for building the pixman code.
config("pixman_private_config") {
visibility = [ ":*" ]
cflags = [
"-Wno-expansion-to-defined",
"-Wno-missing-field-initializers",
"-Wno-shift-negative-value",
"-Wno-sign-compare",
"-Wno-tautological-constant-out-of-range-compare",
"-Wno-unused-const-variable",
"-Wno-unused-local-typedef",
"-Wno-unused-function",
# Release builds in Fuchsia define -ffunction-sections, which causes
# the link of the combined cairo/pixman library to fail on x86_64.
"-fno-function-sections",
]
if (current_cpu == "arm64") {
cflags += [
"-Wno-unknown-attributes",
]
}
defines = [ "HAVE_CONFIG_H" ]
include_dirs = [ target_gen_dir ]
}
# The autoconf build generates these headers after following a series of steps that will produce the
# same thing every time in Fuchsia, so we just check the results in and copy them to the out
# directory.
copy("pixman_config_h") {
visibility = [ ":*" ]
sources = [
"config.h.fuchsia",
]
# The GN source expansion {{source_name_part}} strips the '.fuchsia' extension.
outputs = [
"$target_gen_dir/{{source_name_part}}",
]
}
# This header needs to be exposed to users of the library, but we don't want to put our config.h on
# the include path downstream to avoid colliding with other headers of this name, so we put it in
# its own directory.
copy("pixman_version_h") {
visibility = [ ":*" ]
sources = [
"pixman-version.h.fuchsia",
]
outputs = [
# The GN source expansion {{source_name_part}} strips the '.fuchsia' extension.
"$target_gen_dir/pixman-version/{{source_name_part}}",
]
}
source_set("pixman") {
sources = [
"pixman/pixman-access-accessors.c",
"pixman/pixman-access.c",
"pixman/pixman-arm.c",
"pixman/pixman-bits-image.c",
"pixman/pixman-combine-float.c",
"pixman/pixman-combine32.c",
"pixman/pixman-conical-gradient.c",
"pixman/pixman-edge-accessors.c",
"pixman/pixman-edge.c",
"pixman/pixman-fast-path.c",
"pixman/pixman-filter.c",
"pixman/pixman-general.c",
"pixman/pixman-glyph.c",
"pixman/pixman-gradient-walker.c",
"pixman/pixman-image.c",
"pixman/pixman-implementation.c",
"pixman/pixman-linear-gradient.c",
"pixman/pixman-matrix.c",
"pixman/pixman-mips.c",
"pixman/pixman-noop.c",
"pixman/pixman-ppc.c",
"pixman/pixman-radial-gradient.c",
"pixman/pixman-region16.c",
"pixman/pixman-region32.c",
"pixman/pixman-solid-fill.c",
"pixman/pixman-timer.c",
"pixman/pixman-trap.c",
"pixman/pixman-utils.c",
"pixman/pixman-x86.c",
"pixman/pixman.c",
]
public_configs = [ ":pixman_config" ]
deps = [
":pixman_private",
]
if (current_cpu == "x64") {
sources += [
"pixman/pixman-sse2.c",
]
deps += [
":pixman_ssse3",
]
}
}
source_set("pixman_ssse3") {
visibility = [ ":*" ]
sources = [
"pixman/pixman-ssse3.c",
]
cflags = [ "-mssse3" ]
configs += [ ":pixman_config" ]
deps = [
":pixman_private",
]
}