summaryrefslogtreecommitdiffstats
path: root/Tests/Assembler/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-07-05 13:05:40 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-07-05 13:05:40 (GMT)
commit5021eb90b9bd2ecc78f108bb9a2c4fb220cc7e9f (patch)
tree95386640a57e84d6395b7f055b8ff5837c14cae6 /Tests/Assembler/CMakeLists.txt
parenta28b298aa66cee7a033d56fbe70b6556486d9103 (diff)
downloadCMake-5021eb90b9bd2ecc78f108bb9a2c4fb220cc7e9f.zip
CMake-5021eb90b9bd2ecc78f108bb9a2c4fb220cc7e9f.tar.gz
CMake-5021eb90b9bd2ecc78f108bb9a2c4fb220cc7e9f.tar.bz2
ENH: add a simple assembler test
Alex
Diffstat (limited to 'Tests/Assembler/CMakeLists.txt')
-rw-r--r--Tests/Assembler/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
new file mode 100644
index 0000000..e68393e
--- /dev/null
+++ b/Tests/Assembler/CMakeLists.txt
@@ -0,0 +1,22 @@
+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_NAME MATCHES Linux AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
+ 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_NAME MATCHES Linux AND CMAKE_SYSTEM_PROCESSOR MATCHES "[ix].?86$")
+
+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)