diff --git a/BUILD.gn b/BUILD.gn index 7dc65ff851a0a42eb75eb4f8a8cbcfaa2961ec2d..4188b748038bdfaa26ec1c3a32b1e454e40af1d2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1190,6 +1190,16 @@ ohos_shared_library("libark_jsruntime_test") { public_configs = [ "$js_root:ark_jsruntime_public_config" ] public_configs += [ ":include_llvm" ] + if (is_ohos && is_clang && enable_pgo && + (target_cpu == "arm" || target_cpu == "arm64")) { + cflags = [ + "-fprofile-use=/path/to/profdata", + "-Wno-error=backend-plugin", + "-Wno-profile-instr-out-of-date", + "-Wno-profile-instr-unprofiled", + ] + } + ldflags = [] if (enable_coverage) { ldflags += [ "--coverage" ]