From 07fca5cd74ae987997c1042e851a213c7f5b2e88 Mon Sep 17 00:00:00 2001 From: Timur Valeev Date: Tue, 12 Jul 2022 19:35:29 +0300 Subject: [PATCH] Add static library target to BUILD.gn Signed-off-by: Timur Valeev --- BUILD.gn | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 5c50c01c..766697b4 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -2,14 +2,6 @@ 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", @@ -29,12 +21,21 @@ ohos_shared_library("libmimalloc_share") { "-fomit-frame-pointer", "-frounding-math", "-pipe", - "-fPIC", "-DMI_DEBUG=0", "-DMI_STAT=2", "-Wno-unsupported-floating-point-opt", "-Wno-bitwise-op-parentheses" - ] + ] +} + +ohos_shared_library("libmimalloc_share") { + configs = [ ":libmimalloc_config" ] + + sources = [ + "src/static.c" + ] + + cflags = [ "-fPIC" ] defines = [ "MI_MALLOC_OVERRIDE", @@ -46,3 +47,16 @@ ohos_shared_library("libmimalloc_share") { install_enable = true } + +ohos_static_library("libmimalloc_static") { + configs = [ ":libmimalloc_config" ] + + sources = [ + "src/static.c" + ] + + defines = [ + "MI_TLS_PTHREAD", + "mimalloc_EXPORTS" + ] +}