blob: bb8834dc22bc19ac09f98858e1659ad6434bc236 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
cmake_minimum_required(VERSION 3.5)
project(cmTest)
#Detect processor
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "amd64")
SET(TEST_PROCESSOR "x86_64")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
SET(TEST_PROCESSOR "x86_64")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i386")
SET(TEST_PROCESSOR "x86")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686")
SET(TEST_PROCESSOR "x86")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
SET(TEST_PROCESSOR "arm")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64")
SET(TEST_PROCESSOR "arm")
else ()
message(FATAL_ERROR "MESON_SKIP_TEST: Unsupported Assembler Platform")
endif ()
#Detect ABI
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
SET(TEST_ABI "sysv")
elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
SET(TEST_ABI "sysv")
elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "NetBSD")
SET(TEST_ABI "sysv")
elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
SET(TEST_ABI "sysv")
else ()
message(FATAL_ERROR "MESON_SKIP_TEST: Unsupported Assembler Platform")
endif ()
SET(TEST_PLATFORM "${TEST_PROCESSOR}-${TEST_ABI}")
if ( ("${TEST_PLATFORM}" MATCHES "x86_64-sysv")
OR ("${TEST_PLATFORM}" MATCHES "x86-sysv")
OR ("${TEST_PLATFORM}" MATCHES "arm-sysv"))
SET(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
enable_language(ASM)
SET(TEST_SOURCE "cmTestAsm.s")
endif ()
add_library(cmTest STATIC cmTest.c ${TEST_SOURCE})
|