增加static 静态库文件

Change-Id: Id332fe66661b761dc04c212cec9ee017e602d489
Signed-off-by: zhangxiao72 <zhangxiao72@huawei.com>
This commit is contained in:
zhangxiao72 2022-05-16 14:27:30 +08:00
parent 8bd351bb42
commit 96f0819b11

View File

@ -13,6 +13,16 @@
import("//build/ohos.gni")
config("config_static") {
cflags = [
"-std=c++17",
"-Wno-error=implicit-fallthrough",
"-Wno-deprecated-declarations",
]
visibility = [ ":*" ]
include_dirs = [ "//third_party/jsoncpp/include" ]
}
config("jsoncpp_config") {
cflags = [
"-std=c++17",
@ -21,6 +31,10 @@ config("jsoncpp_config") {
]
}
config("flag_config") {
cflags_cc = [ "-fexceptions" ]
}
config("jsoncpp_public_config") {
include_dirs = [ "//third_party/jsoncpp/include/" ]
}
@ -42,3 +56,28 @@ ohos_shared_library("jsoncpp") {
part_name = "jsoncpp"
subsystem_name = "thirdparty"
}
ohos_static_library("jsoncpp_static") {
sources = [
"//third_party/jsoncpp/src/lib_json/json_reader.cpp",
"//third_party/jsoncpp/src/lib_json/json_value.cpp",
"//third_party/jsoncpp/src/lib_json/json_writer.cpp",
]
use_exceptions = true
configs = [ ":config_static" ]
public_configs = [ ":jsoncpp_public_config" ]
public_configs += [ ":jsoncpp_config" ]
public_configs += [ ":flag_config" ]
include_dirs = [
"//third_party/jsoncpp/include/json/",
"//third_party/jsoncpp/include/",
]
cflags_cc = [
"-DJSON_USE_EXCEPTION=0",
"-Wall",
"-Werror",
"-Wno-implicit-fallthrough",
]
part_name = "jsoncpp"
subsystem_name = "thirdparty"
}