CodeCommitsIssuesPull requestsActionsInsightsSecurity
09f3d68f6e3adf74bd8106c6bb9532a4b9e3c82d

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cmake/arch.cmake

33lines · modecode

1if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
2 set (ARCH_AARCH64 1)
3endif ()
4if (ARCH_AARCH64 OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
5 set (ARCH_ARM 1)
6endif ()
7if (CMAKE_LIBRARY_ARCHITECTURE MATCHES "i386")
8 set (ARCH_I386 1)
9endif ()
10if ((ARCH_ARM AND NOT ARCH_AARCH64) OR ARCH_I386)
11 set (ARCH_32 1)
12 message (FATAL_ERROR "32bit platforms are not supported")
13endif ()
14
15if (CMAKE_SYSTEM MATCHES "Linux")
16 set (OS_LINUX 1)
17endif ()
18if (CMAKE_SYSTEM MATCHES "FreeBSD")
19 set (OS_FREEBSD 1)
20endif ()
21
22if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
23 set (COMPILER_GCC 1)
24elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
25 set (COMPILER_CLANG 1)
26endif ()
27
28if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64le.*|PPC64LE.*)")
29 set (ARCH_PPC64LE 1)
30 if (COMPILER_CLANG OR (COMPILER_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8))
31 message(FATAL_ERROR "Only gcc-8 is supported for powerpc architecture")
32 endif ()
33endif ()