gpgme uses gpgsm in server mode. To allow gpgme to tell gpgsm to work directly on files instead of on FDs the server commands "ENCRYPT", etc., need to accept file names for input and output alternatively to the input/output FDs.
Alternatively, gpgme could use gpgsm in command mode (just as gpg) instead of in server mode.