blob: 2fc2691c33577dc5c158fadaf489316d753db5ac [file] [log] [blame]
# Copyright 2019 The Fuchsia 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("//build/zircon/migrated_targets.gni")
# Note this leads to "$root_out_dir/obj/ABS_PATH/..." files in the build.
lz4_lib = "//third_party/lz4/lib"
zx_library("lz4") {
sdk = "source"
sdk_headers = [
"lz4/lz4.h",
"lz4/lz4frame.h",
]
sources = [
"$lz4_lib/lz4.c",
"$lz4_lib/lz4frame.c",
"$lz4_lib/lz4hc.c",
"$lz4_lib/xxhash.c",
]
defines = [
"XXH_NAMESPACE=LZ4_",
# Preempt the default that will break symbols out of hidden visibility.
"LZ4LIB_VISIBILITY=",
# lz4frame.h doesn't let you just predefine LZ4FLIB_API like you can
# LZ4LIB_VISIBILITY, so this kludge works with how its macros are
# defined so the //third_party/lz4 sources don't need to be touched.
"LZ4_DLL_IMPORT=1",
"__declspec(x)=",
]
configs += [ "//build/config:Wno-implicit-fallthrough" ]
# TODO(https://fxbug.dev/41766): Update past https://github.com/lz4/lz4/pull/989 and remove this.
configs += [ ":undefined_behavior_null_pointer_arithmetic" ]
}
config("undefined_behavior_null_pointer_arithmetic") {
cflags = [ "-fno-sanitize=pointer-overflow" ]
}
group("tests") {
testonly = true
deps = [ "test:tests" ]
}