build: cmake cross-compilation fixes