summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/IAR-CXX.cmake
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2018-09-10 11:44:26 (GMT)
committerBrad King <brad.king@kitware.com>2018-09-10 13:03:47 (GMT)
commita26ebb894b192b0156f6a0802ecc4b1f872fcff3 (patch)
treed1e96a56070c5eb382e52d08db02230a19218d18 /Modules/Compiler/IAR-CXX.cmake
parentcc5bac458b85081f813a2c169fda104f59233c37 (diff)
downloadCMake-a26ebb894b192b0156f6a0802ecc4b1f872fcff3.zip
CMake-a26ebb894b192b0156f6a0802ecc4b1f872fcff3.tar.gz
CMake-a26ebb894b192b0156f6a0802ecc4b1f872fcff3.tar.bz2
IAR: Abort if compiler version or target architecture is not detected
If these are not detected then we cannot support the IAR compiler. Fail early with an explicit message instead of silently proceeding and getting strange errors. Issue: #18333
Diffstat (limited to 'Modules/Compiler/IAR-CXX.cmake')
-rw-r--r--Modules/Compiler/IAR-CXX.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 8d86100..5b783b2 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -10,6 +10,9 @@ if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
#
# --c++ is full C++ and supported since 6.10
if(NOT CMAKE_IAR_CXX_FLAG)
+ if(NOT CMAKE_CXX_COMPILER_VERSION)
+ message(FATAL_ERROR "CMAKE_CXX_COMPILER_VERSION not detected. This should be automatic.")
+ endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.10)
set(CMAKE_IAR_CXX_FLAG --c++)
else()
@@ -48,4 +51,7 @@ elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
get_filename_component(_compilerDir "${_compilerDir}" PATH)
include_directories("${_compilerDir}/inc")
+
+else()
+ message(FATAL_ERROR "CMAKE_CXX_COMPILER_ARCHITECTURE_ID not detected as \"AVR\" or \"ARM\". This should be automatic." )
endif()