diff --git a/inspector/BUILD.gn b/inspector/BUILD.gn index e30db975fa089a082208b7916346c437ecc22504..873fc48fe6b73ed42ae10e52f058023780700c4e 100644 --- a/inspector/BUILD.gn +++ b/inspector/BUILD.gn @@ -88,7 +88,8 @@ ohos_source_set("connectserver_debugger_static") { "connect_server.cpp", ] - if (target_os == "ios") { + if (is_cross_platform_build && + (target_os == "ios" || target_os == "android")) { sources -= [ "../common/log_wrapper.cpp" ] } diff --git a/inspector/inspector.cpp b/inspector/inspector.cpp index b06a7478e5702615f4eb783f870246e94045982e..73f0ca965033c98255598eeb92c63da201fe34df 100644 --- a/inspector/inspector.cpp +++ b/inspector/inspector.cpp @@ -23,7 +23,7 @@ #include "common/log_wrapper.h" #include "library_loader.h" -#if defined(IOS_PLATFORM) +#if defined(IOS_PLATFORM) || defined(ANDROID_PLATFORM) #include "tooling/debugger_service.h" #endif @@ -53,12 +53,12 @@ std::atomic g_hasArkFuncsInited = false; std::unordered_map g_inspectors; std::shared_mutex g_mutex; -#if !defined(IOS_PLATFORM) +#if !defined(IOS_PLATFORM) && !defined(ANDROID_PLATFORM) thread_local void* g_handle = nullptr; #endif thread_local void* g_vm = nullptr; -#if !defined(IOS_PLATFORM) +#if !defined(IOS_PLATFORM) && !defined(ANDROID_PLATFORM) #if defined(WINDOWS_PLATFORM) constexpr char ARK_DEBUGGER_SHARED_LIB[] = "libark_ecma_debugger.dll"; #elif defined(MAC_PLATFORM) @@ -86,7 +86,7 @@ void* HandleClient(void* const server) return nullptr; } -#if !defined(IOS_PLATFORM) +#if !defined(IOS_PLATFORM) && !defined(ANDROID_PLATFORM) bool LoadArkDebuggerLibrary() { if (g_handle != nullptr) { @@ -126,7 +126,7 @@ void ResetServiceLocked() iter->second = nullptr; g_inspectors.erase(iter); } -#if !defined(IOS_PLATFORM) +#if !defined(IOS_PLATFORM) && !defined(ANDROID_PLATFORM) if (g_handle != nullptr) { CloseHandle(g_handle); g_handle = nullptr; @@ -178,7 +178,7 @@ bool InitializeArkFunctions() if (g_hasArkFuncsInited) { return true; } -#if !defined(IOS_PLATFORM) +#if !defined(IOS_PLATFORM) && !defined(ANDROID_PLATFORM) g_initializeDebugger = reinterpret_cast( GetArkDynFunction("InitializeDebugger")); if (g_initializeDebugger == nullptr) { @@ -261,7 +261,7 @@ bool StartDebug(const std::string& componentName, void* vm, bool isDebugMode, int32_t instanceId, const DebuggerPostTask& debuggerPostTask, int port) { g_vm = vm; -#if !defined(IOS_PLATFORM) +#if !defined(IOS_PLATFORM) && !defined(ANDROID_PLATFORM) if (!LoadArkDebuggerLibrary()) { return false; } diff --git a/tooling/BUILD.gn b/tooling/BUILD.gn index 02c337da424717fe503d15784ed64c9419685614..dbdf3cb3af5017e4b44d67c2700396841473c66b 100644 --- a/tooling/BUILD.gn +++ b/tooling/BUILD.gn @@ -63,7 +63,8 @@ ohos_source_set("libark_ecma_debugger_set") { deps = [] - if (is_cross_platform_build && target_os == "ios") { + if (is_cross_platform_build && + (target_os == "ios" || target_os == "android")) { deps += [ "$ark_third_party_root/cJSON:cjson_static" ] } else { deps += [ "$ark_third_party_root/cJSON:cjson" ] diff --git a/websocket/BUILD.gn b/websocket/BUILD.gn index 83a31b52c7aae1881222f97493280745de147d9b..ab036c0fb2d9e30e516d3bc62281eea754f95fa3 100644 --- a/websocket/BUILD.gn +++ b/websocket/BUILD.gn @@ -42,7 +42,8 @@ ohos_source_set("websocket") { sources = [ "websocket.cpp" ] deps += [ sdk_libc_secshared_dep ] - if (is_cross_platform_build && target_os == "ios") { + if (is_cross_platform_build && + (target_os == "ios" || target_os == "android")) { deps += [ "$ark_third_party_root/openssl:libcrypto_static" ] } else if (is_mingw) { deps += [ "$ark_third_party_root/openssl:libcrypto_restool" ]