[cmake-developers] How to deal with assembler files

Alexander Neundorf neundorf at kde.org
Wed Feb 23 15:36:38 EST 2011


On Wednesday 18 August 2010, Brad King wrote:
> On 08/18/2010 01:03 PM, Alexander Neundorf wrote:
> > If the files are written that way (and built without cmake before), the
> > developers want to have them processed with the actual compiler, because
> > that's what they are always doing.
> > IMO that's not wrong, because if the compiler can also process assembler
> > files, then it can be considered also a valid "compiler" for assembler,
> > no matter that it is "also" a C compiler.
> >
> > Maybe I didn't make one thing clear.
> > There are of course separate CMAKE_ASM_COMPILER, CMAKE_ASM_COMPILE_OBJECT
> > etc. variables. It's just that CMAKE_ASM_COMPILER will be the same
> > executable as CMAKE_C_COMPILER.
>
> You're right, I misunderstood your proposal.  Part (1) is exactly what
> I had in mind.  The users just happen to chose the C compiler as the
> ASM language compiler.  It does not need C to be enabled.  Good.
>
> For part (2) I think you can use my suggestion: CMAKE_ASM_PREPROCESSOR
> might happen to be set to a C compiler but can also be a preprocessor.
>
> To help IAR choose an assembler that matches the C compiler, take a
> look at what we do in CMakeDetermineFortranCompiler.cmake around the
> comment "Prefer vendors matching the C and C++ compilers.".
>
> -Brad

This is now on stage in the "ReworkedAsmSupport" branch.
I'd like to merge this into next, if there are no objections.
It implements what we discussed here, i.e. if there is already a C/CXX 
compiler it tries to use that too for assembler, if not, it tries to find 
such a compiler.

Alex




More information about the cmake-developers mailing list