diff --git a/BUILD.gn b/BUILD.gn index 597ca96..0ba9d28 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -13,7 +13,66 @@ import("//arkcompiler/toolchain/toolchain.gni") +config("hiviewdfx_config") { + defines = [] + if (enable_dump_in_faultlog) { + defines += [ "ENABLE_DUMP_IN_FAULTLOG" ] + } + if (enable_bytrace) { + defines += [ "ENABLE_BYTRACE" ] + cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ] + } + if (enable_hitrace) { + defines += [ "ENABLE_HITRACE" ] + } + if (enable_hilog) { + defines += [ "ENABLE_HILOG" ] + } + + include_dirs = [ "$hilog_root/include" ] +} + +config("ark_platform_config") { + configs = [ ":hiviewdfx_config" ] + defines = [] + if (is_ohos) { + defines += [ + "OHOS_PLATFORM", + "UNIX_PLATFORM", + ] + } else if (is_mingw) { + defines += [ "WINDOWS_PLATFORM" ] + } else if (target_os == "android") { + if (!ark_standalone_build) { + defines += [ + "ANDROID_PLATFORM", + "UNIX_PLATFORM", + ] + } else { + defines += [ "UNIX_PLATFORM" ] + } + } else if (target_os == "ios") { + defines += [ + "UNIX_PLATFORM", + "IOS_PLATFORM", + ] + } else if (is_mac) { + defines += [ + "MAC_PLATFORM", + "UNIX_PLATFORM", + ] + } else { + defines += [ "UNIX_PLATFORM" ] + } +} + config("ark_toolchain_common_config") { + configs = [ + ":ark_platform_config", + ":ark_toolchain_public_config", + ":hiviewdfx_config", + ] + defines = [ "PANDA_ENABLE_LTO" ] cflags_cc = [ "-Wall", @@ -106,7 +165,7 @@ config("ark_toolchain_public_config") { # Dependent on runtime_core include "$ark_root", "$js_root", - "$toolchain_root", + ".", ] } @@ -118,10 +177,7 @@ config("toolchain_test_config") { "./websocket/test/*", ] - configs = [ - "$toolchain_root:ark_toolchain_public_config", - "$toolchain_root:ark_toolchain_common_config", - ] + configs = [ ":ark_toolchain_common_config" ] ldflags = [ "-Wl,-rpath=\$ORIGIN/" ] } @@ -130,11 +186,11 @@ group("ark_toolchain_packages") { deps = [] if (host_os != "mac") { deps += [ - "$toolchain_root/inspector:ark_debugger", - "$toolchain_root/inspector:connectserver_debugger", - "$toolchain_root/tooling:libark_ecma_debugger", - "$toolchain_root/tooling/client:libark_client", - "$toolchain_root/tooling/client/ark_cli:arkdb", + "./inspector:ark_debugger", + "./inspector:connectserver_debugger", + "./tooling:libark_ecma_debugger", + "./tooling/client:libark_client", + "./tooling/client/ark_cli:arkdb", ] } } diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index 7194c19..940894e 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -78,11 +78,18 @@ group("runtime_core") { } group("toolchain") { + deps = [] if (target_cpu != "mipsel") { - deps = [ + deps += [ "$toolchain_root/inspector:ark_debugger", "$toolchain_root/inspector:connectserver_debugger", "$toolchain_root/tooling:libark_ecma_debugger", ] } + if (target_os != "mingw") { + deps += [ + "$toolchain_root/tooling/client:libark_client", + "$toolchain_root/tooling/client/ark_cli:arkdb", + ] + } } diff --git a/inspector/log_wrapper.cpp b/common/log_wrapper.cpp similarity index 97% rename from inspector/log_wrapper.cpp rename to common/log_wrapper.cpp index 14c33c6..0ee14c5 100644 --- a/inspector/log_wrapper.cpp +++ b/common/log_wrapper.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include #ifdef ANDROID_PLATFORM diff --git a/inspector/log_wrapper.h b/common/log_wrapper.h similarity index 100% rename from inspector/log_wrapper.h rename to common/log_wrapper.h diff --git a/inspector/BUILD.gn b/inspector/BUILD.gn index 964c72a..e30db97 100644 --- a/inspector/BUILD.gn +++ b/inspector/BUILD.gn @@ -13,59 +13,6 @@ import("//arkcompiler/toolchain/toolchain.gni") -config("hiviewdfx_config") { - defines = [] - if (enable_dump_in_faultlog) { - defines += [ "ENABLE_DUMP_IN_FAULTLOG" ] - } - if (enable_bytrace) { - defines += [ "ENABLE_BYTRACE" ] - cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ] - } - if (enable_hitrace) { - defines += [ "ENABLE_HITRACE" ] - } - if (enable_hilog) { - defines += [ "ENABLE_HILOG" ] - } - - include_dirs = [ "$hilog_root/include" ] -} - -config("ark_platform_config") { - configs = [ ":hiviewdfx_config" ] - defines = [] - if (is_ohos) { - defines += [ - "OHOS_PLATFORM", - "UNIX_PLATFORM", - ] - } else if (is_mingw) { - defines += [ "WINDOWS_PLATFORM" ] - } else if (target_os == "android") { - if (!ark_standalone_build) { - defines += [ - "ANDROID_PLATFORM", - "UNIX_PLATFORM", - ] - } else { - defines += [ "UNIX_PLATFORM" ] - } - } else if (target_os == "ios") { - defines += [ - "UNIX_PLATFORM", - "IOS_PLATFORM", - ] - } else if (is_mac) { - defines += [ - "MAC_PLATFORM", - "UNIX_PLATFORM", - ] - } else { - defines += [ "UNIX_PLATFORM" ] - } -} - ohos_source_set("ark_debugger_static") { stack_protector_ret = false deps = [ sdk_libc_secshared_dep ] @@ -87,9 +34,9 @@ ohos_source_set("ark_debugger_static") { deps += [ "../websocket:websocket" ] sources = [ + "../common/log_wrapper.cpp", "inspector.cpp", "library_loader.cpp", - "log_wrapper.cpp", "ws_server.cpp", ] @@ -97,7 +44,7 @@ ohos_source_set("ark_debugger_static") { external_deps = hiviewdfx_ext_deps deps += hiviewdfx_deps - configs += [ ":ark_platform_config" ] + configs += [ "..:ark_toolchain_common_config" ] subsystem_name = "arkcompiler" part_name = "toolchain" } @@ -136,20 +83,20 @@ ohos_source_set("connectserver_debugger_static") { deps += [ "../websocket:websocket" ] sources = [ + "../common/log_wrapper.cpp", "connect_inspector.cpp", "connect_server.cpp", - "log_wrapper.cpp", ] if (target_os == "ios") { - sources -= [ "log_wrapper.cpp" ] + sources -= [ "../common/log_wrapper.cpp" ] } # hiviewdfx libraries external_deps = hiviewdfx_ext_deps deps += hiviewdfx_deps - configs += [ ":ark_platform_config" ] + configs += [ "..:ark_toolchain_common_config" ] subsystem_name = "arkcompiler" part_name = "toolchain" } diff --git a/inspector/connect_inspector.cpp b/inspector/connect_inspector.cpp index 8536147..4560c20 100644 --- a/inspector/connect_inspector.cpp +++ b/inspector/connect_inspector.cpp @@ -15,7 +15,7 @@ #include "connect_inspector.h" #include -#include "log_wrapper.h" +#include "common/log_wrapper.h" namespace OHOS::ArkCompiler::Toolchain { std::mutex g_connectMutex; diff --git a/inspector/connect_server.cpp b/inspector/connect_server.cpp index c2f1b6a..f57b3e7 100644 --- a/inspector/connect_server.cpp +++ b/inspector/connect_server.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "log_wrapper.h" +#include "common/log_wrapper.h" namespace OHOS::ArkCompiler::Toolchain { std::shared_mutex g_sendMutex; diff --git a/inspector/inspector.cpp b/inspector/inspector.cpp index 1a30764..b06a747 100644 --- a/inspector/inspector.cpp +++ b/inspector/inspector.cpp @@ -20,7 +20,7 @@ #include #include -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "library_loader.h" #if defined(IOS_PLATFORM) diff --git a/inspector/library_loader.cpp b/inspector/library_loader.cpp index 1cb61ad..e13b8bb 100644 --- a/inspector/library_loader.cpp +++ b/inspector/library_loader.cpp @@ -15,7 +15,7 @@ #include "library_loader.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #if defined(UNIX_PLATFORM) #include diff --git a/inspector/ws_server.cpp b/inspector/ws_server.cpp index 7135582..092acb0 100644 --- a/inspector/ws_server.cpp +++ b/inspector/ws_server.cpp @@ -21,7 +21,7 @@ #include #include -#include "log_wrapper.h" +#include "common/log_wrapper.h" namespace OHOS::ArkCompiler::Toolchain { std::shared_mutex g_mutex; diff --git a/tooling/BUILD.gn b/tooling/BUILD.gn index 306ddc3..ad40a36 100644 --- a/tooling/BUILD.gn +++ b/tooling/BUILD.gn @@ -13,28 +13,9 @@ import("../toolchain.gni") -config("hiviewdfx_config") { - defines = [] - if (enable_dump_in_faultlog) { - defines += [ "ENABLE_DUMP_IN_FAULTLOG" ] - } - if (enable_bytrace) { - defines += [ "ENABLE_BYTRACE" ] - cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ] - } - if (enable_hitrace) { - defines += [ "ENABLE_HITRACE" ] - } - if (enable_hilog) { - defines += [ "ENABLE_HILOG" ] - } - - include_dirs = [ "$hilog_root/include" ] -} - config("ark_ecma_debugger_config") { configs = [ - ":hiviewdfx_config", + "..:ark_toolchain_common_config", "//arkcompiler/ets_runtime:ark_jsruntime_common_config", "//arkcompiler/ets_runtime:ark_jsruntime_public_config", ] @@ -49,6 +30,7 @@ config("ark_ecma_debugger_config") { } debugger_sources = [ + "../common/log_wrapper.cpp", "agent/debugger_impl.cpp", "agent/runtime_impl.cpp", "agent/tracing_impl.cpp", diff --git a/tooling/client/BUILD.gn b/tooling/client/BUILD.gn index c19de03..0da6fe2 100644 --- a/tooling/client/BUILD.gn +++ b/tooling/client/BUILD.gn @@ -13,25 +13,6 @@ import("//arkcompiler/toolchain/toolchain.gni") -config("hiviewdfx_config") { - defines = [] - if (enable_dump_in_faultlog) { - defines += [ "ENABLE_DUMP_IN_FAULTLOG" ] - } - if (enable_bytrace) { - defines += [ "ENABLE_BYTRACE" ] - cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ] - } - if (enable_hitrace) { - defines += [ "ENABLE_HITRACE" ] - } - if (enable_hilog) { - defines += [ "ENABLE_HILOG" ] - } - - include_dirs = [ "$hilog_root/include" ] -} - ohos_source_set("libark_client_set") { stack_protector_ret = false defines = [] @@ -64,17 +45,17 @@ ohos_source_set("libark_client_set") { ] deps += [ + "$ark_third_party_root/libuv:uv", "$ark_third_party_root/openssl:libcrypto_shared", - "../:libark_ecma_debugger_set", - "//third_party/libuv:uv", + "..:libark_ecma_debugger_set", sdk_libc_secshared_dep, ] external_deps += [ "ets_runtime:libark_jsruntime" ] - configs += [ ":hiviewdfx_config" ] + configs += [ "../..:ark_toolchain_common_config" ] - cflags_cc = [ "-Wno-error=vla-extension" ] + cflags_cc = [ "-Wno-vla-extension" ] subsystem_name = "arkcompiler" part_name = "toolchain" diff --git a/tooling/client/ark_cli/BUILD.gn b/tooling/client/ark_cli/BUILD.gn index 0cc992b..b76c481 100644 --- a/tooling/client/ark_cli/BUILD.gn +++ b/tooling/client/ark_cli/BUILD.gn @@ -13,70 +13,6 @@ import("//arkcompiler/toolchain/toolchain.gni") -config("hiviewdfx_config") { - defines = [] - if (enable_dump_in_faultlog) { - defines += [ "ENABLE_DUMP_IN_FAULTLOG" ] - } - if (enable_bytrace) { - defines += [ "ENABLE_BYTRACE" ] - cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ] - } - if (enable_hitrace) { - defines += [ "ENABLE_HITRACE" ] - } - if (enable_hilog) { - defines += [ "ENABLE_HILOG" ] - } - - include_dirs = [ "$hilog_root/include" ] - - if (is_linux) { - defines += [ - "PANDA_TARGET_UNIX", - "PANDA_TARGET_LINUX", - "PANDA_USE_FUTEX", - ] - } else if (is_mingw) { - cflags_cc += [ - "-std=c++17", - "-Wno-ignored-attributes", - ] - defines += [ - "PANDA_TARGET_WINDOWS", - "_CRTBLD", - "__LIBMSVCRT__", - ] - } else if (is_mac) { - defines += [ - "PANDA_TARGET_UNIX", - "PANDA_TARGET_MACOS", - ] - } else if (target_os == "android") { - defines += [ - "PANDA_TARGET_ANDROID", - "PANDA_TARGET_UNIX", - "PANDA_USE_FUTEX", - ] - if (!ark_standalone_build) { - defines += [ "ENABLE_ANLOG" ] - } - } else if (target_os == "ios") { - defines += [ - "PANDA_TARGET_UNIX", - "PANDA_TARGET_IOS", - ] - } else { - defines += [ - "PANDA_TARGET_UNIX", - "PANDA_USE_FUTEX", - ] - if (!is_standard_system && (current_cpu != "arm" || is_wearable_product)) { - defines += [ "PANDA_TARGET_MOBILE" ] - } - } -} - ohos_executable("arkdb") { sources = [ "cli_command.cpp", @@ -96,12 +32,13 @@ ohos_executable("arkdb") { deps = [ "../:libark_client_set" ] - external_deps = [ - "ets_runtime:libark_jsruntime", - "hitrace:hitrace_meter", - ] + external_deps = [ "ets_runtime:libark_jsruntime" ] - configs = [ ":hiviewdfx_config" ] + # hiviewdfx libraries + external_deps += hiviewdfx_ext_deps + deps += hiviewdfx_deps + + configs = [ "../../..:ark_toolchain_common_config" ] install_enable = false diff --git a/tooling/client/ark_cli/cli_command.cpp b/tooling/client/ark_cli/cli_command.cpp index 44ddf07..e40531b 100644 --- a/tooling/client/ark_cli/cli_command.cpp +++ b/tooling/client/ark_cli/cli_command.cpp @@ -23,7 +23,7 @@ #include "domain/debugger_client.h" #include "domain/runtime_client.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "manager/breakpoint_manager.h" #include "manager/domain_manager.h" #include "manager/stack_manager.h" diff --git a/tooling/client/ark_cli/cli_command.h b/tooling/client/ark_cli/cli_command.h index af5ce7b..0f20062 100644 --- a/tooling/client/ark_cli/cli_command.h +++ b/tooling/client/ark_cli/cli_command.h @@ -23,7 +23,7 @@ #include "domain/heapprofiler_client.h" #include "domain/profiler_client.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "manager/domain_manager.h" #include "websocket/websocket_client.h" diff --git a/tooling/client/ark_cli/main.cpp b/tooling/client/ark_cli/main.cpp index 4095e1c..22e29bf 100644 --- a/tooling/client/ark_cli/main.cpp +++ b/tooling/client/ark_cli/main.cpp @@ -63,7 +63,7 @@ std::vector SplitString(const std::string &str, const std::string & return value; } -void ReleaseHandle(uv_async_t *handle) +void ReleaseHandle([[maybe_unused]] uv_async_t *releaseHandle) { uv_close(reinterpret_cast(g_inputSignal), [](uv_handle_t* handle) { if (handle != nullptr) { @@ -108,7 +108,7 @@ void InputOnMessage(uv_async_t *handle) } } -void GetInputCommand(void *arg) +void GetInputCommand([[maybe_unused]] void *arg) { std::cout << ">>> "; std::string inputStr; @@ -152,7 +152,7 @@ void SocketOnMessage(uv_async_t *handle) } } -void GetSocketMessage(void *arg) +void GetSocketMessage([[maybe_unused]] void *arg) { while (g_cliSocket.IsConnected()) { std::string decMessage = g_cliSocket.Decode(); diff --git a/tooling/client/domain/debugger_client.cpp b/tooling/client/domain/debugger_client.cpp index 64580ed..6ea81a0 100644 --- a/tooling/client/domain/debugger_client.cpp +++ b/tooling/client/domain/debugger_client.cpp @@ -17,7 +17,7 @@ #include -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "manager/breakpoint_manager.h" #include "manager/stack_manager.h" #include "pt_json.h" diff --git a/tooling/client/domain/heapprofiler_client.cpp b/tooling/client/domain/heapprofiler_client.cpp index dd9d8c9..bf79367 100644 --- a/tooling/client/domain/heapprofiler_client.cpp +++ b/tooling/client/domain/heapprofiler_client.cpp @@ -14,7 +14,7 @@ */ #include "domain/heapprofiler_client.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "utils/utils.h" #include diff --git a/tooling/client/domain/profiler_client.cpp b/tooling/client/domain/profiler_client.cpp index 0fccd3a..b83cdd1 100644 --- a/tooling/client/domain/profiler_client.cpp +++ b/tooling/client/domain/profiler_client.cpp @@ -15,7 +15,7 @@ #include "domain/profiler_client.h" #include "pt_types.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "utils/utils.h" #include diff --git a/tooling/client/domain/runtime_client.cpp b/tooling/client/domain/runtime_client.cpp index fa52d80..d0abd02 100644 --- a/tooling/client/domain/runtime_client.cpp +++ b/tooling/client/domain/runtime_client.cpp @@ -15,7 +15,7 @@ #include "domain/runtime_client.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "manager/variable_manager.h" #include "pt_json.h" diff --git a/tooling/client/manager/breakpoint_manager.cpp b/tooling/client/manager/breakpoint_manager.cpp index 34d8b8c..1b3cd1a 100644 --- a/tooling/client/manager/breakpoint_manager.cpp +++ b/tooling/client/manager/breakpoint_manager.cpp @@ -15,7 +15,7 @@ #include "manager/breakpoint_manager.h" #include "ark_cli/cli_command.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; diff --git a/tooling/client/manager/domain_manager.cpp b/tooling/client/manager/domain_manager.cpp index 6ffb3d7..1a46426 100644 --- a/tooling/client/manager/domain_manager.cpp +++ b/tooling/client/manager/domain_manager.cpp @@ -15,7 +15,7 @@ #include "domain_manager.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "manager/breakpoint_manager.h" #include "pt_json.h" diff --git a/tooling/client/manager/stack_manager.cpp b/tooling/client/manager/stack_manager.cpp index e39b006..1ce0348 100644 --- a/tooling/client/manager/stack_manager.cpp +++ b/tooling/client/manager/stack_manager.cpp @@ -14,7 +14,7 @@ */ #include "manager/stack_manager.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" namespace OHOS::ArkCompiler::Toolchain { StackManager StackManager::instance_; diff --git a/tooling/client/manager/stack_manager.h b/tooling/client/manager/stack_manager.h index 9b668f1..e9cee68 100644 --- a/tooling/client/manager/stack_manager.h +++ b/tooling/client/manager/stack_manager.h @@ -19,7 +19,7 @@ #include #include -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "pt_json.h" #include "pt_types.h" diff --git a/tooling/client/manager/variable_manager.cpp b/tooling/client/manager/variable_manager.cpp index e410ac8..574e439 100644 --- a/tooling/client/manager/variable_manager.cpp +++ b/tooling/client/manager/variable_manager.cpp @@ -15,7 +15,9 @@ #include "manager/variable_manager.h" -#include "log_wrapper.h" +#include + +#include "common/log_wrapper.h" using PtJson = panda::ecmascript::tooling::PtJson; namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/client/utils/utils.cpp b/tooling/client/utils/utils.cpp index 573bb47..ca615e4 100644 --- a/tooling/client/utils/utils.cpp +++ b/tooling/client/utils/utils.cpp @@ -14,7 +14,7 @@ */ #include "utils/utils.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include namespace OHOS::ArkCompiler::Toolchain { diff --git a/tooling/client/websocket/websocket_client.cpp b/tooling/client/websocket/websocket_client.cpp index e15da1d..15af188 100644 --- a/tooling/client/websocket/websocket_client.cpp +++ b/tooling/client/websocket/websocket_client.cpp @@ -19,7 +19,7 @@ #include #include -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "websocket_client.h" diff --git a/websocket/BUILD.gn b/websocket/BUILD.gn index 8c1a797..83a31b5 100644 --- a/websocket/BUILD.gn +++ b/websocket/BUILD.gn @@ -13,83 +13,6 @@ import("//arkcompiler/toolchain/toolchain.gni") -config("hiviewdfx_config") { - defines = [] - if (enable_dump_in_faultlog) { - defines += [ "ENABLE_DUMP_IN_FAULTLOG" ] - } - if (enable_bytrace) { - defines += [ "ENABLE_BYTRACE" ] - cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ] - } - if (enable_hitrace) { - defines += [ "ENABLE_HITRACE" ] - } - if (enable_hilog) { - defines += [ "ENABLE_HILOG" ] - } - - include_dirs = [ "$hilog_root/include" ] -} - -config("websocket_platform_config") { - configs = [ ":hiviewdfx_config" ] - defines = [] - if (is_ohos) { - defines += [ - "OHOS_PLATFORM", - "UNIX_PLATFORM", - ] - } else if (is_mingw) { - defines += [ "WINDOWS_PLATFORM" ] - } else if (is_mac) { - defines += [ - "MAC_PLATFORM", - "UNIX_PLATFORM", - ] - } else if (target_os == "android") { - if (!ark_standalone_build) { - defines += [ - "ANDROID_PLATFORM", - "UNIX_PLATFORM", - ] - } else { - defines += [ "UNIX_PLATFORM" ] - } - } else if (target_os == "ios") { - defines += [ - "UNIX_PLATFORM", - "IOS_PLATFORM", - ] - } else { - defines += [ "UNIX_PLATFORM" ] - } - - if (current_cpu == "arm") { - defines += [ - "PANDA_TARGET_ARM32_ABI_SOFT=1", - "PANDA_TARGET_ARM32", - "PANDA_TARGET_32", - ] - } else if (current_cpu == "arm64") { - defines += [ - "PANDA_TARGET_ARM64", - "PANDA_TARGET_64", - "PANDA_ENABLE_GLOBAL_REGISTER_VARIABLES", - "PANDA_USE_32_BIT_POINTER", - ] - } else if (current_cpu == "x86") { - defines += [ "PANDA_TARGET_X86" ] - } else if (current_cpu == "amd64" || current_cpu == "x64" || - current_cpu == "x86_64") { - defines += [ - "PANDA_TARGET_64", - "PANDA_TARGET_AMD64", - "PANDA_USE_32_BIT_POINTER", - ] - } -} - ohos_source_set("websocket") { stack_protector_ret = false defines = [] @@ -127,7 +50,9 @@ ohos_source_set("websocket") { deps += [ "$ark_third_party_root/openssl:libcrypto_shared" ] } - configs += [ ":websocket_platform_config" ] + configs += [ "..:ark_toolchain_common_config" ] + + cflags_cc = [ "-Wno-vla-extension" ] subsystem_name = "arkcompiler" part_name = "toolchain" diff --git a/websocket/test/BUILD.gn b/websocket/test/BUILD.gn index d777162..0d3ec59 100644 --- a/websocket/test/BUILD.gn +++ b/websocket/test/BUILD.gn @@ -23,14 +23,11 @@ host_unittest_action("WebSocketTest") { sources = [ # test file - "../../inspector/log_wrapper.cpp", + "../../common/log_wrapper.cpp", "websocket_test.cpp", ] - configs = [ - "//arkcompiler/toolchain:toolchain_test_config", - "$toolchain_root/websocket:websocket_platform_config", - ] + configs = [ "$toolchain_root:toolchain_test_config" ] deps = [ "$toolchain_root/websocket:websocket", diff --git a/websocket/websocket.cpp b/websocket/websocket.cpp index 8ab6f28..d92cbcb 100644 --- a/websocket/websocket.cpp +++ b/websocket/websocket.cpp @@ -16,7 +16,7 @@ #include "websocket.h" #include "define.h" -#include "log_wrapper.h" +#include "common/log_wrapper.h" #include "securec.h" namespace OHOS::ArkCompiler::Toolchain { @@ -357,7 +357,7 @@ bool WebSocket::InitTcpWebSocket(int port, uint32_t timeoutLimit) return false; } - sockaddr_in addr_sin = {0}; + sockaddr_in addr_sin = {}; addr_sin.sin_family = AF_INET; addr_sin.sin_port = htons(port); addr_sin.sin_addr.s_addr = INADDR_ANY;