Gyorgy Szing | 964c7d8 | 2019-04-11 15:16:09 +0200 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 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 | |
| 11 | if(NOT DEFINED CMAKE_ASM_COMPILER) |
| 12 | message(FATAL_ERROR "Please set CMAKE_ASM_COMPILER to hold the full path of\ |
| 13 | your compiler executable") |
| 14 | endif() |
| 15 | |
| 16 | get_filename_component(_ASM_COMPILER_NAME ${CMAKE_ASM_COMPILER} NAME) |
| 17 | |
| 18 | #Based on the name of the compiler executable select which tool we use. |
| 19 | if (_ASM_COMPILER_NAME MATCHES "^.*armclang(\\.exe)?$") |
| 20 | set(ARM_TOOLCHAIN_FILE "Compiler/ARMClang-ASM") |
| 21 | elseif(_ASM_COMPILER_NAME MATCHES "^.*armasm(\\.exe)?$") |
| 22 | set(ARM_TOOLCHAIN_FILE "Compiler/ARMCC-ASM") |
| 23 | elseif (_ASM_COMPILER_NAME MATCHES "^.*gcc(\\.exe)?$") |
| 24 | set(ARM_TOOLCHAIN_FILE "Compiler/GNUARM-ASM") |
| 25 | else() |
| 26 | message(FATAL_ERROR "ASM Compiler executable ${_ASM_COMPILER_NAME} is \ |
| 27 | unknown. Please add needed settings to ${CMAKE_CURRENT_LIST_FILE}") |
| 28 | endif () |
| 29 | |
| 30 | include(${ARM_TOOLCHAIN_FILE}) |