HPCC-10283 Ensure GLOBAL(,OPT) is processed correctly inside a library

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #5049 from ghalliday/issue10283

HPCC-10283 Ensure GLOBAL(,OPT) is processed correctly inside a library

Reviewed-By: Jamie Noss <james.noss@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>