[CMake] Cmake 2.8 and cross compilation

Alexander Neundorf a.neundorf-work at gmx.net
Tue Nov 17 14:20:52 EST 2009


On Monday 16 November 2009, Alexander Neundorf wrote:
> On Monday 16 November 2009, Emmanuel Blot wrote:
> > > If the file needs to be preprocessed, set the LANGUAGE source file
> > > property to C, this should work in most cases for now.
> >
> > Yes they (many of them) do
> >
> > Is there anyway in CMake to tell something like "all .S file should be
> > built with GCC" or something like this, so that developers do not have
> > to cope with CMake bolts and nuts for every asm file they add to a
> > project?
> >
> > I'm not sure to understand how to build .S files with some compiler
> > option switches, and C files with other option switches.
> > As an example C and C++ languages may use distinct options using
> > CMAKE_C_... anc CMAKE_CXX_ flags, but how this work if I tell CMake
> > that a S file is a C file, which is not?
>
> please have a look at the attached file and replace the
> CMakeDetermineASMCompiler.cmake which comes with cmake with it.
> Then enable the language "ASM" (not ASM-ATT) and then all *.s, *.S and
> *.asm files should be processed by the C compiler with separate
> ASM-specific flags. Let me know if you think this approach makes sense
> (i.e. use the C compiler for asm files, and ASM-ATT if they are really
> plain assembler files with no preprocessing etc.)

That's the respective bug report:
http://public.kitware.com/Bug/view.php?id=8392

Alex


More information about the CMake mailing list