How to disable certain plugin automatically based on the packaging platform

I am currently developing a multi-platform plugin(Lets call this pA). However, I run into an issue where few VR plugins(Lets call them pB) cannot be packaged to Android and IOS platform. Is there anyway where I can disable certain plugins like pB from pA before the packaging.