CMake and assembly sources

I've been trying to figure out how to "nicely" integrate building assembler sources with CMake. After some digging around, I found a nice recipe recently posted to CMake mailing list:

set_property(SOURCE cputorture.s PROPERTY LANGUAGE C)

This works because the C compiler, at least on UNIX, recognizes .s as assembler source extension and invokes the proper assembler command.


Sima said...

Thanks a lot for this little blog post, it helped us a lot with cmake and asm-files =)

Chadversary said...

Thank you for sharing your discovery. It was just the antidote to my headache.