diff --git a/sensor/hal/BUILD.gn b/sensor/hal/BUILD.gn index cf8d94f1a3cbdb063acd28de99859f449483b3e9..9d2024f99f2be88f9c09c62bc849e1fe22a76e10 100644 --- a/sensor/hal/BUILD.gn +++ b/sensor/hal/BUILD.gn @@ -57,6 +57,12 @@ if (defined(ohos_lite)) { "-fno-common", "-fno-strict-aliasing", ] + if (ohos_build_compiler != "clang") { + cflags += [ + "-wno-format", + "-wno-format-extra-args", + ] + } } lite_component("hdi") { diff --git a/sensor/test/performance/BUILD.gn b/sensor/test/performance/BUILD.gn index 6e5e37c46fe39967ece71a7675889f73d190d754..dc34adce9a415e8b7831aada255ca55671fc80d8 100644 --- a/sensor/test/performance/BUILD.gn +++ b/sensor/test/performance/BUILD.gn @@ -37,6 +37,12 @@ unittest("hdf_peripheral_sensor_test_performance") { "-fno-common", "-fno-strict-aliasing", ] + if (ohos_build_compiler != "clang") { + cflags += [ + "-wno-format", + "-wno-format-extra-args", + ] + } deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//drivers/adapter/uhdf/manager:hdf_core", diff --git a/sensor/test/unittest/BUILD.gn b/sensor/test/unittest/BUILD.gn index 6ae99ac57840c86252db8a6ddb4e74df9799bda6..52294314f3c4dfd9e41393e4eae12f7c9ec90d05 100644 --- a/sensor/test/unittest/BUILD.gn +++ b/sensor/test/unittest/BUILD.gn @@ -45,6 +45,12 @@ if (defined(ohos_lite)) { "-fno-common", "-fno-strict-aliasing", ] + if (ohos_build_compiler != "clang") { + cflags += [ + "-wno-format", + "-wno-format-extra-args", + ] + } deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//drivers/adapter/uhdf/manager:hdf_core",