1 cmake_minimum_required (VERSION 2.6)
6 # if no file has been set as source and we are on linux with an x86 processor try to use the gas/as assembler
7 # main-linux-x86-gas.s seems to work for Linux and FreeBSD
8 if(NOT SRCS AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
9 if(CMAKE_SYSTEM MATCHES Linux OR CMAKE_SYSTEM MATCHES FreeBSD)
10 message(STATUS "Trying to enable ASM-ATT for Linux or FreeBSD on x86")
11 enable_language(ASM-ATT OPTIONAL)
12 if(CMAKE_ASM-ATT_COMPILER_WORKS)
13 message(STATUS "Trying to enable ASM-ATT for Linux/x86 - succeeded")
14 # this assembler file was created using gcc -S main.c
15 set(SRCS main-linux-x86-gas.s)
16 endif(CMAKE_ASM-ATT_COMPILER_WORKS)
17 endif(CMAKE_SYSTEM MATCHES Linux OR CMAKE_SYSTEM MATCHES FreeBSD)
18 endif(NOT SRCS AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
21 message(STATUS "No assembler enabled, using C")
25 add_executable(HelloAsm ${SRCS})
26 set_target_properties(HelloAsm PROPERTIES LINKER_LANGUAGE C)