diff --git a/BUILD.gn b/BUILD.gn index 1ba0e1e74cf8b5771d3fc5216f57e0d4dd894ad6..0c720663da323dfe7c5ab4080cf743e7f5bec60f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -14,115 +14,9 @@ import("//build/ohos.gni") import("//third_party/cares/cares.gni") -cares_srcs = [ - "ares__addrinfo2hostent.c", - "ares__addrinfo_localhost.c", - "ares__close_sockets.c", - "ares__get_hostent.c", - "ares__parse_into_addrinfo.c", - "ares__read_line.c", - "ares__readaddrinfo.c", - "ares__sortaddrinfo.c", - "ares__timeval.c", - "ares_android.c", - "ares_cancel.c", - "ares_create_query.c", - "ares_data.c", - "ares_destroy.c", - "ares_expand_name.c", - "ares_expand_string.c", - "ares_fds.c", - "ares_free_hostent.c", - "ares_free_string.c", - "ares_freeaddrinfo.c", - "ares_getaddrinfo.c", - "ares_getenv.c", - "ares_gethostbyaddr.c", - "ares_gethostbyname.c", - "ares_getnameinfo.c", - "ares_getsock.c", - "ares_init.c", - "ares_library_init.c", - "ares_llist.c", - "ares_mkquery.c", - "ares_nowarn.c", - "ares_options.c", - "ares_parse_a_reply.c", - "ares_parse_aaaa_reply.c", - "ares_parse_caa_reply.c", - "ares_parse_mx_reply.c", - "ares_parse_naptr_reply.c", - "ares_parse_ns_reply.c", - "ares_parse_ptr_reply.c", - "ares_parse_soa_reply.c", - "ares_parse_srv_reply.c", - "ares_parse_txt_reply.c", - "ares_parse_uri_reply.c", - "ares_platform.c", - "ares_process.c", - "ares_query.c", - "ares_rand.c", - "ares_search.c", - "ares_send.c", - "ares_strcasecmp.c", - "ares_strdup.c", - "ares_strerror.c", - "ares_strsplit.c", - "ares_timeout.c", - "ares_version.c", - "ares_writev.c", - "bitncmp.c", - "inet_net_pton.c", - "inet_ntop.c", - "windows_port.c", -] - -sources_test = [ - "test/ares-test-main.cc", - "test/ares-test.cc", - "test/ares-test-ns.cc", - "test/ares-test-parse.cc", - "test/ares-test-parse-a.cc", - "test/ares-test-parse-aaaa.cc", - "test/ares-test-parse-caa.cc", - "test/ares-test-parse-mx.cc", - "test/ares-test-parse-naptr.cc", - "test/ares-test-parse-ns.cc", - "test/ares-test-parse-ptr.cc", - "test/ares-test-parse-soa.cc", - "test/ares-test-parse-soa-any.cc", - "test/ares-test-parse-srv.cc", - "test/ares-test-parse-txt.cc", - "test/ares-test-parse-uri.cc", - "test/ares-test-misc.cc", - "test/ares-test-mock.cc", - "test/ares-test-internal.cc", - "test/dns-proto.cc", - "test/dns-proto-test.cc", - "test/gmock-1.11.0/gmock-gtest-all.cc", -] - -src_path = "//third_party/cares" cares_path = root_out_dir + "/third_party_cares" code_dir = cares_path + "/c-ares-1.18.1" -action("installOpenEulerCares") { - print("Cares install") - script = "install.sh" - args = [ - rebase_path(src_path, root_build_dir), - rebase_path(cares_path, root_build_dir), - ] - inputs = [ src_path ] - outputs = [] - foreach(src, cares_srcs) { - outputs += [ "$code_dir/src/lib/" + src ] - } - foreach(test, sources_test) { - outputs += [ "$code_dir/" + test ] - } -} - config("c_ares_config") { cflags = [ "-D_GNU_SOURCE", @@ -132,7 +26,7 @@ config("c_ares_config") { ] } ohos_shared_library("c_ares") { - deps = [ ":installOpenEulerCares" ] + deps = [ "//third_party/curl:installOpenEulerCares" ] install_images = [ "updater", "system", @@ -155,12 +49,12 @@ ohos_shared_library("c_ares") { ] install_enable = true - subsystem_name = "thirdparty" - part_name = "cares" + subsystem_name = "communication" + part_name = "netstack" } ohos_static_library("c_ares_static") { - deps = [ ":installOpenEulerCares" ] + deps = [ "//third_party/curl:installOpenEulerCares" ] sources = [] foreach(src, cares_srcs) { sources += [ "$code_dir/src/lib/" + src ] @@ -173,8 +67,8 @@ ohos_static_library("c_ares_static") { "$code_dir", "$code_dir/include", ] - subsystem_name = "thirdparty" - part_name = "cares" + subsystem_name = "communication" + part_name = "netstack" } ohos_executable("cares_test") { @@ -184,7 +78,7 @@ ohos_executable("cares_test") { } deps = [ ":c_ares", - ":installOpenEulerCares", + "//third_party/curl:installOpenEulerCares", ] include_dirs = [ "//third_party/cares/include", @@ -194,8 +88,8 @@ ohos_executable("cares_test") { "$code_dir/test", "$code_dir/test/gmock-1.11.0", ] - subsystem_name = "thirdparty" - part_name = "cares" + subsystem_name = "communication" + part_name = "netstack" } group("c_ares_target") { diff --git a/bundle.json b/bundle.json deleted file mode 100644 index d835fb8a5a0822f7ec58f7a06f7d5d5371f4bace..0000000000000000000000000000000000000000 --- a/bundle.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@ohos/cares", - "description": "c-ares is a C library for asynchronous DNS requests.", - "version": "3.1", - "license": "MIT", - "publishAs": "code-segment", - "segment": { - "destPath": "third_party/cares" - }, - "dirs": {}, - "scripts": {}, - "licensePath": "LICENSE.md", - "component": { - "name": "cares", - "subsystem": "thirdparty", - "syscap": [], - "features": [], - "adapted_system_type": [], - "rom": "", - "ram": "", - "deps": { - "components": [], - "third_party": [] - }, - "build": { - "sub_component": [], - "inner_kits": [], - "test": [] - } - } -} diff --git a/cares.gni b/cares.gni index 44f8080c074f7dc2c3ddd417ef9a4ad90312aad6..4aab6b5da513c0accc17ff3ce5650eea96579271 100644 --- a/cares.gni +++ b/cares.gni @@ -13,3 +13,91 @@ # build type definitions CARES_SOURCE_ROOT = "//third_party/cares/c-ares-1.18.1" + +cares_srcs = [ + "ares__addrinfo2hostent.c", + "ares__addrinfo_localhost.c", + "ares__close_sockets.c", + "ares__get_hostent.c", + "ares__parse_into_addrinfo.c", + "ares__read_line.c", + "ares__readaddrinfo.c", + "ares__sortaddrinfo.c", + "ares__timeval.c", + "ares_android.c", + "ares_cancel.c", + "ares_create_query.c", + "ares_data.c", + "ares_destroy.c", + "ares_expand_name.c", + "ares_expand_string.c", + "ares_fds.c", + "ares_free_hostent.c", + "ares_free_string.c", + "ares_freeaddrinfo.c", + "ares_getaddrinfo.c", + "ares_getenv.c", + "ares_gethostbyaddr.c", + "ares_gethostbyname.c", + "ares_getnameinfo.c", + "ares_getsock.c", + "ares_init.c", + "ares_library_init.c", + "ares_llist.c", + "ares_mkquery.c", + "ares_nowarn.c", + "ares_options.c", + "ares_parse_a_reply.c", + "ares_parse_aaaa_reply.c", + "ares_parse_caa_reply.c", + "ares_parse_mx_reply.c", + "ares_parse_naptr_reply.c", + "ares_parse_ns_reply.c", + "ares_parse_ptr_reply.c", + "ares_parse_soa_reply.c", + "ares_parse_srv_reply.c", + "ares_parse_txt_reply.c", + "ares_parse_uri_reply.c", + "ares_platform.c", + "ares_process.c", + "ares_query.c", + "ares_rand.c", + "ares_search.c", + "ares_send.c", + "ares_strcasecmp.c", + "ares_strdup.c", + "ares_strerror.c", + "ares_strsplit.c", + "ares_timeout.c", + "ares_version.c", + "ares_writev.c", + "bitncmp.c", + "inet_net_pton.c", + "inet_ntop.c", + "windows_port.c", +] + +sources_test = [ + "test/ares-test-main.cc", + "test/ares-test.cc", + "test/ares-test-ns.cc", + "test/ares-test-parse.cc", + "test/ares-test-parse-a.cc", + "test/ares-test-parse-aaaa.cc", + "test/ares-test-parse-caa.cc", + "test/ares-test-parse-mx.cc", + "test/ares-test-parse-naptr.cc", + "test/ares-test-parse-ns.cc", + "test/ares-test-parse-ptr.cc", + "test/ares-test-parse-soa.cc", + "test/ares-test-parse-soa-any.cc", + "test/ares-test-parse-srv.cc", + "test/ares-test-parse-txt.cc", + "test/ares-test-parse-uri.cc", + "test/ares-test-misc.cc", + "test/ares-test-mock.cc", + "test/ares-test-internal.cc", + "test/dns-proto.cc", + "test/dns-proto-test.cc", + "test/gmock-1.11.0/gmock-gtest-all.cc", +]