blob: 7bef05d23b567ad276463a9391182d30e3a432df [file] [log] [blame]
Gyorgy Szing964c7d82019-04-11 15:16:09 +02001#-------------------------------------------------------------------------------
2# Copyright (c) 2019, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8#Built in compiler identification does not work for embedded targets, so
9#override it here.
10
11if(NOT DEFINED CMAKE_ASM_COMPILER)
12 message(FATAL_ERROR "Please set CMAKE_ASM_COMPILER to hold the full path of\
13 your compiler executable")
14endif()
15
16get_filename_component(_ASM_COMPILER_NAME ${CMAKE_ASM_COMPILER} NAME)
17
18#Based on the name of the compiler executable select which tool we use.
19if (_ASM_COMPILER_NAME MATCHES "^.*armclang(\\.exe)?$")
20 set(ARM_TOOLCHAIN_FILE "Compiler/ARMClang-ASM")
21elseif(_ASM_COMPILER_NAME MATCHES "^.*armasm(\\.exe)?$")
22 set(ARM_TOOLCHAIN_FILE "Compiler/ARMCC-ASM")
23elseif (_ASM_COMPILER_NAME MATCHES "^.*gcc(\\.exe)?$")
24 set(ARM_TOOLCHAIN_FILE "Compiler/GNUARM-ASM")
25else()
26 message(FATAL_ERROR "ASM Compiler executable ${_ASM_COMPILER_NAME} is \
27unknown. Please add needed settings to ${CMAKE_CURRENT_LIST_FILE}")
28endif ()
29
30include(${ARM_TOOLCHAIN_FILE})