Created
December 5, 2016 21:48
-
-
Save vpetrigo/29e3bfbe7d4aa133e4f661c8420af172 to your computer and use it in GitHub Desktop.
CMake template for using Clang + ARM toolchain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.2) | |
set(CMAKE_CROSSCOMPILING TRUE) | |
set(CMAKE_SYSTEM_NAME Linux) | |
set(CMAKE_SYSTEM_PROCESSOR arm) | |
set(gcc_toolchain "$ENV{USERPROFILE}\\Documents\\Projects\\toolchains\\gcc-mingw32-arm-linux-gnueabihf") | |
set(triple arm-linux-gnueabihf) | |
set(cpu_type cortex-a7) | |
set(fpu_type neon-vfpv4) | |
set(float_abi_type hard) | |
set(CMAKE_C_COMPILER clang) | |
set(CMAKE_C_COMPILER_TARGET ${triple}) | |
set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN ${gcc_toolchain}) | |
set(CMAKE_SYSROOT ${gcc_toolchain}\\arm-linux-gnueabihf\\libc) | |
set(CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -B${gcc_toolchain}\\bin -mcpu=${cpu_type} -mfpu=${fpu_type} -mfloat-abi=${float_abi_type}") | |
project(arm_test C) | |
set(arm_test_SRC main.c) | |
add_executable(arm_test ${arm_test_SRC}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment