From 26c548fba8fd7c84ff23ac0e9799f44ffbef936e Mon Sep 17 00:00:00 2001 From: ZhenyuPan Date: Thu, 20 Oct 2022 11:40:07 +0800 Subject: [PATCH] Add define for ohos platform Issue:https://gitee.com/openharmony/arkcompiler_toolchain/issues/I5WPUH Signed-off-by: ZhenyuPan Change-Id: I96453b60307576e205f92605227105875381ba13 --- inspector/BUILD.gn | 54 ++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/inspector/BUILD.gn b/inspector/BUILD.gn index 872061a4..4cd8bd53 100644 --- a/inspector/BUILD.gn +++ b/inspector/BUILD.gn @@ -25,6 +25,35 @@ config("ark_debugger_config") { ] } +config("ark_platform_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") { + defines += [ + "ANDROID_PLATFORM", + "UNIX_PLATFORM", + ] + } else if (target_os == "ios") { + defines += [ + "UNIX_PLATFORM", + "IOS_PLATFORM", + ] + } else { + defines += [ "UNIX_PLATFORM" ] + } +} + ohos_shared_library("ark_debugger") { deps = [ ":ark_debugger_static" ] @@ -62,26 +91,6 @@ ohos_source_set("ark_debugger_static") { if (is_mingw || is_mac) { cflags = [ "-std=c++17" ] - if (is_mingw) { - defines += [ "WINDOWS_PLATFORM" ] - } else { - defines += [ - "MAC_PLATFORM", - "UNIX_PLATFORM", - ] - } - } else if (target_os == "android") { - defines += [ - "ANDROID_PLATFORM", - "UNIX_PLATFORM", - ] - } else if (target_os == "ios") { - defines += [ - "UNIX_PLATFORM", - "IOS_PLATFORM", - ] - } else { - defines += [ "UNIX_PLATFORM" ] } include_dirs = [ @@ -109,5 +118,8 @@ ohos_source_set("ark_debugger_static") { [ "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" ] } - configs = [ ":ark_debugger_config" ] + configs = [ + ":ark_debugger_config", + ":ark_platform_config", + ] } -- Gitee