[CMake] Assembler and C++ for the same target

Hendrik Sattler post at hendrik-sattler.de
Thu Sep 25 13:42:34 EDT 2008


Am Thursday 25 September 2008 17:45:54 schrieb Stefan Weber:
> I am working on a C++ project which is using a single assembler file (among
> all the C++ files). In the mailinglist archives I found some hints on how
> to use the experimental ASM mode. However, as I only have a single ASM
> file, I'm not sure how to handle that: Ideally, I would like to pass it to
> add_library with all the other source files (in the same way I can pass it
> to C++ which automatically forwards it to the assembler). This is not
> working,

Stop. The next step is no logical one. If it doesn't work for one target, why 
should it for another?

> cmake_minimum_required(VERSION 2.6)
> project(TEST)
> enable_language(ASM)
> add_library(asmtest MyAsm.S)

That looks fine. And just adding the assembler file works here. Are you 
cross-compiling? If yes, did you define CMAKE_ASM_COMPILER?
What is the compilation output? (make VERBOSE=1)
Does that file actually appear there?

HS


More information about the CMake mailing list