diff --git a/BUILD.gn b/BUILD.gn index 3bcff223d29af908c375a61fc623f8ed1cd1b082..68b4ef46977738346dec3741ea0b62601356fea7 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,7 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//build/ohos.gni") +if (!defined(ark_flag)){ + import("//build/ohos.gni") +}else{ + import("//build/ark.gni") +} config("jsoncpp_config") { cflags = [ @@ -22,22 +26,41 @@ config("jsoncpp_config") { } config("jsoncpp_public_config") { + cflags_cc = [ "-fexceptions", "-fPIC",] include_dirs = [ "//third_party/jsoncpp/include/" ] } -ohos_shared_library("jsoncpp") { - visibility = [ "*" ] +source_set("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 = [ ":jsoncpp_config" ] + public_configs = [ ":jsoncpp_config" ] + include_dirs = [ "//third_party/jsoncpp/include/json/", "//third_party/jsoncpp/include/", ] - public_configs = [ ":jsoncpp_public_config" ] - subsystem_name = "distributeddatamgr" + public_configs += [ ":jsoncpp_public_config" ] +} + +group("jsoncpp_target") { + # Config to apply to all targets that depend on this one. + public_configs = [ ":jsoncpp_public_config" ] +} + +if (!defined(ark_flag)){ + ohos_shared_library("jsoncpp") { + visibility = [ "*" ] + deps = [ ":jsoncpp_static" ] + public_deps = [ ":jsoncpp_target" ] + subsystem_name = "distributeddatamgr" + } +}else { + ark_shared_library("jsoncpp") { + visibility = [ "*" ] + deps = [ ":jsoncpp_static" ] + public_deps = [ ":jsoncpp_target" ] + } }