!21 增加static 静态库文件

Merge pull request !21 from zhangxiao72/master
This commit is contained in:
openharmony_ci 2022-05-17 10:11:18 +00:00 committed by Gitee
commit 63b758fbfc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

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"
}