[Cmake-commits] CMake branch, master, updated. v3.13.3-947-gc59eae7

Kitware Robot kwrobot at kitware.com
Wed Jan 16 10:03:05 EST 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  c59eae7ebc5423c2b06befd762f8639b0f23b7a0 (commit)
       via  270965e0c7dadccc3564f7ab825cd4e618a15e42 (commit)
       via  7414d422b267718e737637fefa01b94502febb0e (commit)
      from  bd54cc774a5b14720a9e741fc40192ea11106443 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c59eae7ebc5423c2b06befd762f8639b0f23b7a0
commit c59eae7ebc5423c2b06befd762f8639b0f23b7a0
Merge: bd54cc7 270965e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 16 14:53:52 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Jan 16 09:53:58 2019 -0500

    Merge topic 'iar-avr'
    
    270965e0c7 IAR: Update compiler modules to support AVR systems
    7414d422b2 IAR: Parse INFO strings from the binary format of AVR systems
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2792


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=270965e0c7dadccc3564f7ab825cd4e618a15e42
commit 270965e0c7dadccc3564f7ab825cd4e618a15e42
Author:     Ethan Slattery <theslat at gmail.com>
AuthorDate: Thu Jan 10 17:26:37 2019 -0800
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 15 13:59:01 2019 -0500

    IAR: Update compiler modules to support AVR systems
    
    Fixes: #18557

diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
index 2ed8818..b5e61f0 100644
--- a/Modules/Compiler/IAR-C.cmake
+++ b/Modules/Compiler/IAR-C.cmake
@@ -29,7 +29,19 @@ if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
   __compiler_check_default_language_standard(C 1.10 90 6.10 99 8.10 11)
 
 elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+  if(NOT CMAKE_C_COMPILER_VERSION)
+    message(FATAL_ERROR "CMAKE_C_COMPILER_VERSION not detected.  This should be automatic.")
+  endif()
+
+  set(CMAKE_C_EXTENSION_COMPILE_OPTION -e)
+
+  set(CMAKE_C90_STANDARD_COMPILE_OPTION --c89)
+  set(CMAKE_C90_EXTENSION_COMPILE_OPTION -e)
+  set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
+  set(CMAKE_C99_EXTENSION_COMPILE_OPTION -e)
+
   __compiler_iar_AVR(C)
+  __compiler_check_default_language_standard(C 7.10 99)
   set(CMAKE_C_OUTPUT_EXTENSION ".r90")
 
   if(NOT CMAKE_C_LINK_FLAGS)
@@ -43,6 +55,7 @@ elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
   get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
   get_filename_component(_compilerDir "${_compilerDir}" PATH)
   include_directories("${_compilerDir}/inc" )
+  include_directories("${_compilerDir}/inc/Atmel" )
 
 else()
   message(FATAL_ERROR "CMAKE_C_COMPILER_ARCHITECTURE_ID not detected as \"AVR\" or \"ARM\".  This should be automatic.")
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 5b783b2..b7076f5 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -38,7 +38,27 @@ if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
   __compiler_check_default_language_standard(CXX 6.10 98 8.10 14)
 
 elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+  # "embedded C++" --EC++ is probably closest to CXX98 but with no support for:
+  #  Templates, multiple inheritance, virtual inheritance, exceptions, RTTI, C++ style casts,
+  #  Namespaces, the mutable attribute, no STL, any library features related to the above features.
+  #
+  # "(extended) embedded C++" --EEC++ Mode but DOES NOT support any normal C++ standard
+  # probably closest to CXX98 but with no RTTI and no exceptions, and the library
+  # provided is not in the standard namespace
+  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()
+    set(CMAKE_IAR_CXX_FLAG --eec++)
+  endif()
+
+  set(CMAKE_CXX_EXTENSION_COMPILE_OPTION -e)
+  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -e)
+
   __compiler_iar_AVR(CXX)
+  __compiler_check_default_language_standard(CXX 7.10 98)
+
   set(CMAKE_CXX_OUTPUT_EXTENSION ".r90")
   if(NOT CMAKE_CXX_LINK_FLAGS)
     set(CMAKE_CXX_LINK_FLAGS "-Fmotorola")
@@ -51,6 +71,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")
+  include_directories("${_compilerDir}/inc/Atmel")
 
 else()
   message(FATAL_ERROR "CMAKE_CXX_COMPILER_ARCHITECTURE_ID not detected as \"AVR\" or \"ARM\".  This should be automatic." )
diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake
index a1bffeb..43477ac 100644
--- a/Modules/Compiler/IAR-DetermineCompiler.cmake
+++ b/Modules/Compiler/IAR-DetermineCompiler.cmake
@@ -1,4 +1,4 @@
-# IAR Systems compiler for embedded systems.
+# IAR Systems compiler for ARM embedded systems.
 #   http://www.iar.com
 #   http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf
 #
@@ -9,13 +9,31 @@
 # __ICCARM__          An integer that is set to 1 when the code is compiled with the IAR C/C++ Compiler for ARM
 # __VER__             An integer that identifies the version number of the IAR compiler in use. For example,
 #                     version 5.11.3 is returned as 5011003.
+#
+# IAR Systems Compiler for AVR embedded systems
+#  http://supp.iar.com/FilesPublic/UPDINFO/007051/ew/doc/EWAVR_CompilerReference.pdf
+#
+# __IAR_SYSTEMS_ICC__ An integer that identifies the IAR compiler platform.
+# __ICCAVR__          An integer that is set to 1 when the code is compiled with the IAR C/C++ Compiler for AVR
+# __VER__             An integer that identifies the version number of the IAR compiler in use.
+#                     The value is calculated by (100 * VERSION_MAJOR + VERSION_MINOR). For example the version
+#                     3.34 is given as 334
+# __SUBVERSION__      An integer that identifies the subversion number of the compiler version number
+#                     for example 3 in 1.2.3.4.  THis is used as the patch version, as seen when running iccavr
+#                     from the command line
+#
 
 set(_compiler_id_pp_test "defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)")
 
 set(_compiler_id_version_compute "
-# if defined(__VER__)
+# if defined(__VER__) && defined(__ICCARM__)
 #  define @PREFIX at COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 1000000)
 #  define @PREFIX at COMPILER_VERSION_MINOR @MACRO_DEC@(((__VER__) / 1000) % 1000)
 #  define @PREFIX at COMPILER_VERSION_PATCH @MACRO_DEC@((__VER__) % 1000)
 #  define @PREFIX at COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__)
+# elif defined(__VER__) && defined(__ICCAVR__)
+#  define @PREFIX at COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 100)
+#  define @PREFIX at COMPILER_VERSION_MINOR @MACRO_DEC@((__VER__) - (((__VER__) / 100)*100))
+#  define @PREFIX at COMPILER_VERSION_PATCH @MACRO_DEC@(__SUBVERSION__)
+#  define @PREFIX at COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__)
 # endif")
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")
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7414d422b267718e737637fefa01b94502febb0e
commit 7414d422b267718e737637fefa01b94502febb0e
Author:     Ethan Slattery <theslat at gmail.com>
AuthorDate: Wed Nov 7 19:24:17 2018 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 15 13:58:53 2019 -0500

    IAR: Parse INFO strings from the binary format of AVR systems
    
    Teach `CMakeDetermineCompilerId` to recognize and parse the IAR-AVR
    binary format so we can recognize this compiler id.
    
    Issue: #18557

diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 050d3e7..f987d9a 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -523,7 +523,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
     file(STRINGS ${file}
       CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 38
       ${CMAKE_${lang}_COMPILER_ID_STRINGS_PARAMETERS}
-      REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
+      REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]")
     set(COMPILER_ID_TWICE)
     # With the IAR Compiler, some strings are found twice, first time as incomplete
     # list like "?<Constant "INFO:compiler[IAR]">".  Remove the incomplete copies.
@@ -531,6 +531,12 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
     # In C# binaries, some strings are found more than once.
     list(REMOVE_DUPLICATES CMAKE_${lang}_COMPILER_ID_STRINGS)
     foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
+      # The IAR-AVR compiler uses a binary format that places a '6'
+      # character (0x34) before each character in the string.  Strip
+      # out these characters without removing any legitamate characters.
+      if("${info}" MATCHES "(.)I.N.F.O.:.")
+        string(REGEX REPLACE "${CMAKE_MATCH_1}(.)" "\\1" info "${info}")
+      endif()
       if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]")
         if(COMPILER_ID)
           set(COMPILER_ID_TWICE 1)

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakeDetermineCompilerId.cmake       |  8 +++++++-
 Modules/Compiler/IAR-C.cmake                 | 13 +++++++++++++
 Modules/Compiler/IAR-CXX.cmake               | 21 +++++++++++++++++++++
 Modules/Compiler/IAR-DetermineCompiler.cmake | 22 ++++++++++++++++++++--
 Modules/Compiler/IAR.cmake                   | 21 +++++++++++++++++++++
 5 files changed, 82 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list