summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/IAR.cmake
diff options
context:
space:
mode:
authorEthan Slattery <theslat@gmail.com>2019-01-11 01:26:37 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-15 18:59:01 (GMT)
commit270965e0c7dadccc3564f7ab825cd4e618a15e42 (patch)
tree4efc9ab5a28f6554a9b8fe037a0861cd1a976676 /Modules/Compiler/IAR.cmake
parent7414d422b267718e737637fefa01b94502febb0e (diff)
downloadCMake-270965e0c7dadccc3564f7ab825cd4e618a15e42.zip
CMake-270965e0c7dadccc3564f7ab825cd4e618a15e42.tar.gz
CMake-270965e0c7dadccc3564f7ab825cd4e618a15e42.tar.bz2
IAR: Update compiler modules to support AVR systems
Fixes: #18557
Diffstat (limited to 'Modules/Compiler/IAR.cmake')
-rw-r--r--Modules/Compiler/IAR.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index 43243b9..bbcdea2 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -68,6 +68,27 @@ endmacro()
macro(__compiler_iar_AVR lang)
set(CMAKE_EXECUTABLE_SUFFIX ".bin")
+ if (${lang} STREQUAL "C" OR ${lang} STREQUAL "CXX")
+
+ set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
+
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ns <DEPFILE>")
+
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -r")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Ohz -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -Oh -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -Oh -r -DNDEBUG")
+ endif()
+
+ set(CMAKE_${lang}_LINK_EXECUTABLE "\"${CMAKE_IAR_LINKER}\" -S <OBJECTS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "\"${CMAKE_IAR_AR}\" <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_CREATE "\"${CMAKE_IAR_AR}\" <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND "")
+ set(CMAKE_${lang}_ARCHIVE_FINISH "")
set(CMAKE_LIBRARY_PATH_FLAG "-I")