CMake/Tests/Assembler/CMakeLists.txt

25 lines
982 B
CMake
Raw Normal View History

2007-07-05 17:05:40 +04:00
project(Assembler)
set(SRCS)
# if no file has been set as source and we are on linux with an x86 processor try to use the gas/as assembler
if(NOT SRCS AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
# if(NOT SRCS AND CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
2007-07-05 17:05:40 +04:00
message(STATUS "Trying to enable ASM-ATT for Linux/x86")
enable_language(ASM-ATT)
if(CMAKE_ASM-ATT_COMPILER_WORKS)
message(STATUS "Trying to enable ASM-ATT for Linux/x86 - succeeded")
# this assembler file was created using gcc -S main.c
set(SRCS main-linux-x86-gas.s)
endif(CMAKE_ASM-ATT_COMPILER_WORKS)
endif(NOT SRCS AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
# endif(NOT SRCS AND CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
2007-07-05 17:05:40 +04:00
if(NOT SRCS)
message(STATUS "No assembler enabled, using C")
set(SRCS main.c)
endif(NOT SRCS)
add_executable(HelloAsm ${SRCS})
set_target_properties(HelloAsm PROPERTIES LINKER_LANGUAGE C)