[CMake] How to pass -D options when compiling assembly files using gcc?

Michael Wild themiwi at gmail.com
Mon Jul 13 05:29:31 EDT 2009


On 13. Jul, 2009, at 10:28, Eric Noulard wrote:

> 2009/7/12 Marcel Loose <loose at astron.nl>:
>
>>>
>> Hi Eric,
>>
>> Thanks, I'll try that tomorrow. Another option that occurred to me  
>> today
>> is that, since I'm using gcc to preprocess and compile the assembly
>> sources, I might add .S as source file extension to
>> CMAKE_C_SOURCE_FILE_EXTENSIONS. Any idea if that might work?
>
> I really don't know.
> Like I said before I have no experience with ASM file and CMake
> nor the definition of a new compiler variant with CMake.
>
> Once you have tried a little more, I'd rather let CMake developer
> or CMake user with more expeperience in the field
> answer that one :-)
>
>
> -- 
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org


Hi

I think I remember once having seen that for such a thing the LANGUAGE  
property on the .S files was being set to C. Might want to give that a  
shot...

set(ASM_SRCS foo.S bar.S)
set_source_files_properties(${ASM_SRCS} PROPERTIES LANGUAGE C)

Michael


More information about the CMake mailing list