From f67d128ef490bdd5a911846a39720fa7c1ff5aed Mon Sep 17 00:00:00 2001 From: Timur Valeev Date: Tue, 12 Jul 2022 18:24:16 +0300 Subject: [PATCH] Add BUILD.gn Signed-off-by: Timur Valeev --- BUILD.gn | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 BUILD.gn diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 00000000..5c50c01c --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,48 @@ +import("//build/ohos.gni") + +config("libmimalloc_config") { + include_dirs = [ "include" ] +} + +ohos_shared_library("libmimalloc_share") { + public_configs = [ ":libmimalloc_config" ] + + sources = [ + "src/static.c" + ] + + cflags = [ + "-std=c11", + "-Wno-unused-variable", + "-Wno-uninitialized", + "-Qunused-arguments", + "-Wa,--noexecstack", + "-Werror=implicit-function-declaration", + "-Werror=implicit-int", + "-Werror=pointer-arith", + "-Werror=pointer-sign", + "-fdata-sections", + "-ffreestanding", + "-ffunction-sections", + "-fno-asynchronous-unwind-tables", + "-fno-unwind-tables", + "-fomit-frame-pointer", + "-frounding-math", + "-pipe", + "-fPIC", + "-DMI_DEBUG=0", + "-DMI_STAT=2", + "-Wno-unsupported-floating-point-opt", + "-Wno-bitwise-op-parentheses" + ] + + defines = [ + "MI_MALLOC_OVERRIDE", + "MI_SHARED_LIB", + "MI_SHARED_LIB_EXPORT", + "MI_TLS_PTHREAD", + "mimalloc_EXPORTS" + ] + + install_enable = true +}