diff --git a/common/config.gni b/common/config.gni index afb8f0b2b2c929af78fb0a2af507f2cf73b0ebdc..21a43ba4f89a36eeb0ed60772bc9d3b05fb2ca62 100644 --- a/common/config.gni +++ b/common/config.gni @@ -132,4 +132,4 @@ if (flutter_prebuilt_dart_sdk) { # see https://github.com/flutter/flutter/issues/74322 build_engine_artifacts = current_toolchain == host_toolchain || - (is_linux && !is_chromeos && current_cpu != "arm") || is_mac || is_win + (is_linux && !is_chromeos && current_cpu != "arm") || is_mac || is_win || is_ohos diff --git a/shell/platform/ohos/napi/platform_view_ohos_napi.cpp b/shell/platform/ohos/napi/platform_view_ohos_napi.cpp index 6eec795900517d524e82fb5e92a25d2e223f72fd..9dd3f6b272bf10af9dc3f1f56ecd60fdeff235b2 100644 --- a/shell/platform/ohos/napi/platform_view_ohos_napi.cpp +++ b/shell/platform/ohos/napi/platform_view_ohos_napi.cpp @@ -693,13 +693,13 @@ napi_value PlatformViewOHOSNapi::nativeSetViewportMetrics( } LOGD("nativeSetViewportMetrics::shell_holder : %{public}ld", shell_holder); - int64_t devicePixelRatio; - ret = napi_get_value_int64(env, args[1], &devicePixelRatio); + double devicePixelRatio; + ret = napi_get_value_double(env, args[1], &devicePixelRatio); if (ret != napi_ok) { LOGE("nativeSetViewportMetrics napi_get_value_int64 error"); return nullptr; } - LOGD("nativeSetViewportMetrics::devicePixelRatio : %{public}ld", + LOGD("nativeSetViewportMetrics::devicePixelRatio : %{public}lf", devicePixelRatio); int64_t physicalWidth; diff --git a/tools/gn b/tools/gn index 5882b343a643b1bd3f76092e915661115ef8562a..99b7b88e79303c6826e2d3c6db004a126cd310f1 100755 --- a/tools/gn +++ b/tools/gn @@ -343,6 +343,8 @@ def to_gn_args(args): gn_args['target_os'] = args.target_os gn_args['target_cpu'] = get_target_cpu(args) gn_args['dart_target_arch'] = gn_args['target_cpu'] + if (args.target_os == 'ohos'): + gn_args['host_cpu'] = get_host_cpu() print("ARGS.target_os:%s-%s" % (args.target_os,gn_args['target_os'] ) ) # We cannot cross-compile for 32 bit arm on a Windows host. We work around @@ -451,7 +453,7 @@ def to_gn_args(args): else: gn_args['skia_use_gl'] = args.target_os != 'fuchsia' - if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia']: + if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia', 'ohos']: # OpenGL is deprecated on macOS > 10.11. # This is not necessarily needed but enabling this until we have a way to # build a macOS metal only shell and a gl only shell.