[CMake] add_custom_command using CMAKE_CXX_FLAGS

Alexander Neundorf a.neundorf-work at gmx.net
Sat Sep 5 15:31:01 EDT 2009


On Monday 24 August 2009, John Smith wrote:
> On Aug 24, 2009, at 12:48 PM, Tyler Roscoe wrote:
> > On Sun, Aug 23, 2009 at 09:03:22PM -0400, John Smith wrote:
> >> I am using the following test case in an attempt to add a custom
> >> command to build an assembly file. The assembly file should be
> >> compiled with the C++ compiler driver (which in turn should invoke
> >> the
> >> assembler after pre-processing), and I am building up a
> >> CMAKE_CXX_FLAGS variable from separate pieces:
> >
> > I think you can just hand your .S files to add_library(). Did you try
> > searching the ML archives or google for how to handle assembler files
> > with CMake?
>
> I have tried doing that. However, the net end result is that I get a
> rule that invokes the assembler on the assembly source file. My top-
> level assembly source file is a shell containing a bunch of platform-
> specific conditionals, which in turn guard include directives for
> platform-specific assembly source files. 

So you have also hit that bug ?
http://public.kitware.com/Bug/view.php?id=8392

Can you please try the attached patch ?
It introduces a language "ASM-GCC" and removes the extension ".S" from the 
normal assembler support. 
Can you please give it a try ?

Is it only gcc which supports processing assembler files or do other compilers 
also support this ?

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asmgcc.patch
Type: text/x-diff
Size: 3444 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090905/426cdba5/attachment.patch>


More information about the CMake mailing list