1 ###############################################################################
2 # Top contributors (to current version):
3 # Mathias Preiner, Andres Noetzli, Gereon Kremer
5 # This file is part of the cvc5 project.
7 # Copyright (c) 2009-2022 by the authors listed in the file AUTHORS
8 # in the top-level source directory and their institutional affiliations.
9 # All rights reserved. See the file COPYING in the top-level source
10 # directory for licensing information.
11 # #############################################################################
13 # Toolchain file for building for ARM on Ubuntu host.
15 # Use: cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-aarch64.cmake
18 if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
20 set(CMAKE_SYSTEM_NAME Linux)
21 set(CMAKE_SYSTEM_PROCESSOR aarch64)
23 set(TOOLCHAIN_PREFIX aarch64-linux-gnu)
25 set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
26 set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
28 # Set target environment path
29 set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
31 # Adjust the default behaviour of the find_XXX() commands:
32 # search headers and libraries in the target environment, search
33 # programs in the host environment
34 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
35 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
36 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
38 elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
40 set(CMAKE_SYSTEM_NAME Darwin)
41 set(CMAKE_SYSTEM_PROCESSOR arm64)
43 set(TOOLCHAIN_PREFIX arm64-apple-darwin)
45 set(CMAKE_CROSSCOMPILING_MACOS TRUE)
46 set(CMAKE_OSX_ARCHITECTURES arm64 CACHE INTERNAL "")