blob: e38bce53f71413c00224ebe998b51d67096fdd05 [file] [log] [blame]
Gyorgy Szing964c7d82019-04-11 15:16:09 +02001#-------------------------------------------------------------------------------
TTornblom99f0be22019-12-17 16:22:38 +01002# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
Gyorgy Szing964c7d82019-04-11 15:16:09 +02003#
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")
TTornblom99f0be22019-12-17 16:22:38 +010025elseif (_ASM_COMPILER_NAME MATCHES "^.*iasmarm(\\.exe)?$")
26 set(ARM_TOOLCHAIN_FILE "Compiler/IARARM-ASM")
Gyorgy Szing964c7d82019-04-11 15:16:09 +020027else()
28 message(FATAL_ERROR "ASM Compiler executable ${_ASM_COMPILER_NAME} is \
29unknown. Please add needed settings to ${CMAKE_CURRENT_LIST_FILE}")
30endif ()
31
32include(${ARM_TOOLCHAIN_FILE})