fix handling of the defines of optional deps when cross-compiling