[CMake] assembler with non standard extension with gcc compiler

Ivan Sergio Borgonovo mail at webthatworks.it
Wed Oct 30 20:25:52 EDT 2013


Hi,

I'm cross compiling (avr32) with a gcc compiler under Linux and I'm
using a framework where asm extensions aren't directly recognized by
cmake (.x).

gcc is recognized as a valid C and ASM compiler during cmake
configuration.

But still I see cmake running just ar and ranlib on nothing. gcc is not
invoked at all on asm targets.

I've read several "solutions" on the net but none works.

These are the relevant part I've put in my CMakeLists.txt

project(SAM C ASM)

set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS x)
enable_language(C ASM)
set(ASM_OPTIONS "-x assembler-with-cpp")
set(CMAKE_ASM_FLAGS "${CFLAGS} ${ASM_OPTIONS}" )

All asm files are in separate directories with their own CMakeLists.txt
and they are "added" as

add_library(targetname STATIC sourcefile)
SET_TARGET_PROPERTIES(targetname
   PROPERTIES LINKER_LANGUAGE ASM)

thanks

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



More information about the CMake mailing list