0

I'm trying to compile a really gnarly C++ project, cross compiling for Android using CMake.

There are some .S assembly files, but if I add them to the target's source file list and enable_language(ASM), they are passed to clang (from the Android cross-compile toolchain) which tries to compile them as C++ sources, which of course doesn't work.

Is there a way in CMake to define implicit rules, like you can do with GNU make - i.e. a rule that says "to make a *.o from a *.S, run this command" - then I'd be able to invoke the built-in GNU assembler (I'm doing this on Ubuntu).

Alternatively, if anyone knows how to make CMake properly recognize .S files when cross-compiling for Android, I'm very much open to that option as well.

0 Answers0