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

Stefan Weber stefan.weber at gmail.com
Thu Sep 25 17:50:33 EDT 2008


> > 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?


I think I was not clear enough here: it is not working when I combine ASM
source files and CXX source files and as I found out by now, this is
probably not supported anways. (Mixing ASM and C++ source files would be the
ideal scenario because I can do it with g++ directly, too)


> > 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?


No, I'm compiling on the target platform itself.

What is the compilation output? (make VERBOSE=1)
> Does that file actually appear there?


Thanks for the hint, your guess was right, the file does NOT appear there.
My conclusion is that add_library does not look for the right extension,
could that be it? I tried to do:

set(${CMAKE_ASM_SOURCE_FILE_EXTENSIONS} "s;S")

but this does not help. To debug this, I do the following on the next line

message("${CMAKE_ASM_SOURCE_FILE_EXTENSIONS}")

Strangly, this does not print anything, just an empty line. Why is that?
Simliarly, I cannot change CMAKE_ASM_COMPILER. When I echo it, it returns
/usr/bin/as correctly but for a little test, I set it to /usr/bin/c++.
However, when I echo it after the resetting it, the value is still the
original one: /usr/bin/as. So it seems that I somehow cannot define the
variables for ASM mode. Could that be the root of the problem?

Any ideas for a workaround? At this point, I'm desperate enough to accept
any hack...

Thanks,

Stefan


>
>
> HS
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080925/08c3f5e6/attachment-0001.htm>


More information about the CMake mailing list