blob: 08abf86f1dea0cf3f755338444e50dbb6f32d384 [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("$zx_build/public/gn/migrated_targets.gni")
# Note this leads to "$root_out_dir/obj/ABS_PATH/..." files in the build.
lz4_lib = "$zx/third_party/lz4/lib"
zx_library("lz4") {
host = true
sdk = "source"
sdk_headers = [
"lz4/lz4.h",
"lz4/lz4frame.h",
]
sdk_migrated = true
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)=",
]
# TODO(41766): UBSan has found an instance of undefined behavior in this target.
# Disable UBSan for this target temporarily until it is migrated into CI/CQ.
configs += [ "$zx_build_config:temporarily_disable_ubsan_do_not_use" ]
# NOTE: The Zircon build, and zircon toolchains in the Fuchsia build add
# warn-implicit-fallthrough as a default config.
if (zx == "/" || zircon_toolchain != false) {
configs -= [ "$zx_build_config:warn-implicit-fallthrough" ]
}
}
group("tests") {
testonly = true
deps = [ "test:tests" ]
}