Jonny Svärd | 2b8922d | 2022-12-15 12:40:00 +0100 | [diff] [blame] | 1 | # |
| 2 | # SPDX-FileCopyrightText: Copyright 2020-2022 Arm Limited and/or its affiliates <open-source-office@arm.com> |
| 3 | # |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the License); you may |
| 7 | # not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | |
| 19 | # Cross compilation example when using a custom compiler and toolchain files |
| 20 | |
| 21 | set(CMAKE_SYSTEM_NAME Generic) |
| 22 | |
| 23 | set(CMAKE_C_COMPILER /opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc) |
| 24 | set(CMAKE_CXX_COMPILER /opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-g++) |
| 25 | |
| 26 | set(CMAKE_CXX_STANDARD 14) |
| 27 | set(CMAKE_SYSTEM_PROCESSOR "aarch64") |
| 28 | |
| 29 | add_compile_options(-Wall -Wextra) |
| 30 | |
| 31 | set(CMAKE_FIND_ROOT_PATH /opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/aarch64-linux-gnu/) |
| 32 | |
| 33 | set(FIND_LIBRARY_USE_LIB64_PATHS TRUE) |
| 34 | |
| 35 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) |
| 36 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) |
| 37 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
| 38 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) |
| 39 | |
| 40 | |