blob: 2c02a7656ce6cbc53388983de65e65ec9a7998a1 [file] [log] [blame]
Jonny Svärd2b8922d2022-12-15 12:40:00 +01001#
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
21set(CMAKE_SYSTEM_NAME Generic)
22
23set(CMAKE_C_COMPILER /opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc)
24set(CMAKE_CXX_COMPILER /opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-g++)
25
26set(CMAKE_CXX_STANDARD 14)
27set(CMAKE_SYSTEM_PROCESSOR "aarch64")
28
29add_compile_options(-Wall -Wextra)
30
31set(CMAKE_FIND_ROOT_PATH /opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/aarch64-linux-gnu/)
32
33set(FIND_LIBRARY_USE_LIB64_PATHS TRUE)
34
35set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
36set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
37set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
38set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
39
40