diff --git a/meta-ohos-staging/classes/gn.bbclass b/meta-ohos-staging/classes/gn.bbclass
index 3892de5336c3c49225e1159b32464cbc85fba5b5..dbef28d2d380c983bfac1460e1847b1f391f2c94 100644
--- a/meta-ohos-staging/classes/gn.bbclass
+++ b/meta-ohos-staging/classes/gn.bbclass
@@ -35,6 +35,9 @@ GN_ARGS ?= ' \
             target_cpu="${@gn_target_arch_name(d)}" \
 '
 
+# NINJA_ARGS can be added in the recipe
+NINJA_ARGS ?= ""
+
 B = "${WORKDIR}/out"
 
 gn_do_configure() {
@@ -43,7 +46,7 @@ gn_do_configure() {
 }
 
 gn_do_compile() {
-    ninja -C ${B}
+    ninja ${NINJA_ARGS} -C ${B}
 }
 
 gn_do_install() {