blob: 3aab8f5e15dae7838c1fb4291a00acdb5b65d1ff [file] [log] [blame]
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Import list of source files and flags from the jpeg-xl project.
import("src/lib/lib.gni")
# This config is applied to targets that depend on libjxl.
config("libjxl_external_config") {
include_dirs = [
# Path to the public headers.
"src/lib/include",
# Configuration headers normally generated by the cmake build system.
"gen_headers",
]
}
source_set("libjxl") {
sources = rebase_path(libjxl_dec_sources, ".", "src/lib")
cflags_cc = [
"-Wno-shadow",
"-Wno-unused-function",
]
defines = libjxl_version_defines + [
"JPEGXL_ENABLE_SKCMS=1",
# Disabling decode-to-JPEG bytes in the library removes about 20%
# of the binary size (as measured in android arm builds).
# Transcoding back to JPEG is not used in Chrome, only decoding to
# pixels is used even for files that were originally transcoded
# *from* JPEG.
"JPEGXL_ENABLE_TRANSCODE_JPEG=0",
]
if (is_official_build) {
# Disable assertion messages, saving about 6 kB in android.
defines += [ "JXL_DEBUG_ON_ABORT=0" ]
}
include_dirs = [
"src",
"//third_party/skia/include/third_party/skcms", # for "skcms.h"
]
deps = [
"//skia:skcms",
"//third_party/brotli:dec",
"//third_party/highway:libhwy",
]
public_configs = [ ":libjxl_external_config" ]
}