Move gmp build to plugin target and simplify nullptr check.