diff --git a/meta-arm-bsp/recipes-security/optee/optee-test_3.20.0.bb b/meta-arm-bsp/recipes-security/optee/optee-test_3.20.0.bb
index 5f73d414..4409ad5f 100644
--- a/meta-arm-bsp/recipes-security/optee/optee-test_3.20.0.bb
+++ b/meta-arm-bsp/recipes-security/optee/optee-test_3.20.0.bb
@@ -6,7 +6,3 @@ SRC_URI += " \
     file://0003-Update-arm_ffa_user-driver-dependency.patch \
    "
 SRCREV = "5db8ab4c733d5b2f4afac3e9aef0a26634c4b444"
-
-EXTRA_OEMAKE:append = " OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}"
-DEPENDS:append = " openssl"
-CFLAGS:append = " -Wno-error=deprecated-declarations"
diff --git a/meta-arm-bsp/recipes-security/optee/optee-test_3.22.0.bb b/meta-arm-bsp/recipes-security/optee/optee-test_3.22.0.bb
index f1444a1d..eddf04d8 100644
--- a/meta-arm-bsp/recipes-security/optee/optee-test_3.22.0.bb
+++ b/meta-arm-bsp/recipes-security/optee/optee-test_3.22.0.bb
@@ -5,10 +5,6 @@ SRC_URI += " \
    "
 SRCREV = "a286b57f1721af215ace318d5807e63f40186df6"
 
-EXTRA_OEMAKE:append = " OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}"
-DEPENDS:append = " openssl"
-CFLAGS:append = " -Wno-error=deprecated-declarations"
-
 # Include ffa_spmc test group if the SPMC test is enabled.
 # Supported after op-tee v3.20
 EXTRA_OEMAKE:append = "${@bb.utils.contains('MACHINE_FEATURES', 'optee-spmc-test', \
diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
index 90b72b9f..58f10139 100644
--- a/meta-arm/recipes-security/optee/optee-test.inc
+++ b/meta-arm/recipes-security/optee/optee-test.inc
@@ -9,7 +9,7 @@ inherit python3native ptest
 inherit deploy
 require optee.inc
 
-DEPENDS = "optee-client optee-os-tadevkit python3-cryptography-native"
+DEPENDS = "optee-client optee-os-tadevkit python3-cryptography-native openssl"
 
 SRC_URI = "git://github.com/OP-TEE/optee_test.git;branch=master;protocol=https \
            file://run-ptest \
@@ -19,11 +19,14 @@ S = "${WORKDIR}/git"
 B = "${WORKDIR}/build"
 
 EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
+                 OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR} \
                  CROSS_COMPILE_HOST=${HOST_PREFIX} \
                  CROSS_COMPILE_TA=${HOST_PREFIX} \
                  O=${B} \
                "
 
+CFLAGS += "-Wno-error=deprecated-declarations"
+
 do_compile() {
     cd ${S}
     # Top level makefile doesn't seem to handle parallel make gracefully
diff --git a/meta-arm/recipes-security/optee/optee-test_4.%.bbappend b/meta-arm/recipes-security/optee/optee-test_4.%.bbappend
deleted file mode 100644
index e69de29b..00000000
diff --git a/meta-arm/recipes-security/optee/optee-test_4.0.0.bb b/meta-arm/recipes-security/optee/optee-test_4.0.0.bb
index c5a473be..ecd949f4 100644
--- a/meta-arm/recipes-security/optee/optee-test_4.0.0.bb
+++ b/meta-arm/recipes-security/optee/optee-test_4.0.0.bb
@@ -2,10 +2,6 @@ require recipes-security/optee/optee-test.inc
 
 SRCREV = "1c3d6be5eaa6174e3dbabf60928d15628e39b994"
 
-EXTRA_OEMAKE:append = " OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}"
-DEPENDS:append = " openssl"
-CFLAGS:append = " -Wno-error=deprecated-declarations"
-
 # Include ffa_spmc test group if the SPMC test is enabled.
 # Supported after op-tee v3.20
 EXTRA_OEMAKE:append = "${@bb.utils.contains('MACHINE_FEATURES', 'optee-spmc-test', \
