[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2774-g2011fa5

Brad King brad.king at kitware.com
Mon Apr 15 09:17:01 EDT 2013


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, next has been updated
       via  2011fa50de9799b4f74d14be17e66d5a87e770dc (commit)
       via  d118b8b389b680abf5d23ed5e66eabda418b89e0 (commit)
       via  d33f40638dcc34a8c15b6605325446c777afd249 (commit)
       via  22fb73a0d6e27f0ecaf4e10705de204742427b31 (commit)
      from  a3142932e35a29e040e9ced2e8fd96010ea45d09 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2011fa50de9799b4f74d14be17e66d5a87e770dc
commit 2011fa50de9799b4f74d14be17e66d5a87e770dc
Merge: a314293 d118b8b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 15 09:16:54 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Apr 15 09:16:54 2013 -0400

    Merge topic 'AddIARToolchain2' into next
    
    d118b8b Add IAR to the CMakeDetectC(XX)CompilerID.c(pp).in
    d33f406 Add regexps for the IAR toolchain to the vendor list.
    22fb73a Add support files for C, C++ and ASM for the IAR toolchain.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d118b8b389b680abf5d23ed5e66eabda418b89e0
commit d118b8b389b680abf5d23ed5e66eabda418b89e0
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Wed Jan 4 21:36:49 2012 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Apr 15 09:14:35 2013 -0400

    Add IAR to the CMakeDetectC(XX)CompilerID.c(pp).in
    
    With the AVR IAR compiler this can't be found, but it works e.g. for the
    ARM AVR compiler.
    
    Alex

diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index c25df0c..66a5582 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -160,10 +160,9 @@
 # define COMPILER_ID "ADSP"
 
 /* IAR Systems compiler for embedded systems.
-   http://www.iar.com
-   Not supported yet by CMake
-#elif defined(__IAR_SYSTEMS_ICC__)
-# define COMPILER_ID "IAR" */
+   http://www.iar.com */
+#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
+# define COMPILER_ID "IAR"
 
 /* sdcc, the small devices C compiler for embedded systems,
    http://sdcc.sourceforge.net  */
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index e2119c2..5e87715 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -161,6 +161,11 @@
 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
 # define COMPILER_ID "ADSP"
 
+/* IAR Systems compiler for embedded systems.
+   http://www.iar.com */
+#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
+# define COMPILER_ID "IAR"
+
 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
 # define COMPILER_ID "MIPSpro"
 # if defined(_SGI_COMPILER_VERSION)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d33f40638dcc34a8c15b6605325446c777afd249
commit d33f40638dcc34a8c15b6605325446c777afd249
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Wed Apr 10 22:41:15 2013 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Apr 15 09:13:10 2013 -0400

    Add regexps for the IAR toolchain to the vendor list.
    
    The IAR compilers produce object files where the plain strings at least
    sometimes can't be found, see:
    
      http://www.cmake.org/Bug/view.php?id=10176#c19598
    
    Alex

diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 9999f62..3643b17 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -103,6 +103,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI "-h")
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI "Texas Instruments")
 
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU IAR)
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler")
+
   include(CMakeDetermineCompilerId)
   CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
 
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index d2220e0..8769c66 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -120,6 +120,13 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
   set(CMAKE_C_COMPILER_ID)
   file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
     CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
+
+  # The IAR compiler produces weird output.
+  # See http://www.cmake.org/Bug/view.php?id=10176#c19598
+  list(APPEND CMAKE_C_COMPILER_ID_VENDORS IAR)
+  set(CMAKE_C_COMPILER_ID_VENDOR_FLAGS_IAR )
+  set(CMAKE_C_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler")
+
   include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
   CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c)
 
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 6f7e8f6..c79ba89 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -116,6 +116,13 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
   set(CMAKE_CXX_COMPILER_ID)
   file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
     CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
+
+  # The IAR compiler produces weird output.
+  # See http://www.cmake.org/Bug/view.php?id=10176#c19598
+  list(APPEND CMAKE_CXX_COMPILER_ID_VENDORS IAR)
+  set(CMAKE_CXX_COMPILER_ID_VENDOR_FLAGS_IAR )
+  set(CMAKE_CXX_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler")
+
   include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
   CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp)
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=22fb73a0d6e27f0ecaf4e10705de204742427b31
commit 22fb73a0d6e27f0ecaf4e10705de204742427b31
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Wed Jan 4 21:29:11 2012 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Apr 15 09:11:17 2013 -0400

    Add support files for C, C++ and ASM for the IAR toolchain.
    
    The original feature request is at http://www.cmake.org/Bug/view.php?id=10176
    Documentation can be found at http://www.iar.com/website1/1.0.1.0/675/1/
    
    Alex

diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake
new file mode 100644
index 0000000..66fb052
--- /dev/null
+++ b/Modules/Compiler/IAR-ASM.cmake
@@ -0,0 +1,14 @@
+# This file is processed when the IAR compiler is used for an assembler file
+
+include(Compiler/IAR)
+
+set(CMAKE_ASM_COMPILE_OBJECT  "<CMAKE_ASM_COMPILER> <SOURCE> <DEFINES> <FLAGS> -o <OBJECT>")
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
+endif()
+
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s90;asm;msa)
+endif()
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
new file mode 100644
index 0000000..da29447
--- /dev/null
+++ b/Modules/Compiler/IAR-C.cmake
@@ -0,0 +1,34 @@
+# This file is processed when the IAR compiler is used for a C file
+
+
+include(Compiler/IAR)
+
+set(CMAKE_C_COMPILE_OBJECT             "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <FLAGS> -o <OBJECT>")
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE     "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
+
+# The toolchains for ARM and AVR are quite different:
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+
+  set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS> ")
+
+endif()
+
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+  set(CMAKE_C_OUTPUT_EXTENSION ".r90")
+
+  if(NOT CMAKE_C_LINK_FLAGS)
+    set(CMAKE_C_LINK_FLAGS "-Fmotorola")
+  endif()
+
+  set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> -o <TARGET> <OBJECTS> ")
+
+endif()
+
+# add the target specific include directory:
+get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
+get_filename_component(_compilerDir "${_compilerDir}" PATH)
+include_directories("${_compilerDir}/inc" )
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
new file mode 100644
index 0000000..eae9d1b
--- /dev/null
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -0,0 +1,34 @@
+# This file is processed when the IAR compiler is used for a C++ file
+
+include(Compiler/IAR)
+
+set(CMAKE_CXX_COMPILE_OBJECT  "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <FLAGS> -o <OBJECT>")
+
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
+set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE     "<CMAKE_CXX_COMPILER> <SOURCE> <DEFINES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
+
+
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
+
+  set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS> ")
+
+endif()
+
+
+if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR")
+  set(CMAKE_CXX_OUTPUT_EXTENSION ".r90")
+  if(NOT CMAKE_CXX_LINK_FLAGS)
+    set(CMAKE_CXX_LINK_FLAGS "-Fmotorola")
+  endif()
+
+  set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> -o <TARGET> <OBJECTS> ")
+
+endif()
+
+# add the target specific include directory:
+get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
+get_filename_component(_compilerDir "${_compilerDir}" PATH)
+include_directories("${_compilerDir}/inc")
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
new file mode 100644
index 0000000..00e4713
--- /dev/null
+++ b/Modules/Compiler/IAR.cmake
@@ -0,0 +1,46 @@
+# This file is processed when the IAR compiler is used for a C or C++ file
+# Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/
+# The initial feature request is here: http://www.cmake.org/Bug/view.php?id=10176
+# It also contains additional links and information.
+
+if(_IAR_CMAKE_LOADED)
+  return()
+endif()
+set(_IAR_CMAKE_LOADED TRUE)
+
+
+get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
+get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
+get_filename_component(_CMAKE_ASM_TOOLCHAIN_LOCATION "${CMAKE_ASM_COMPILER}" PATH)
+
+
+if("${CMAKE_C_COMPILER}" MATCHES "arm"  OR  "${CMAKE_CXX_COMPILER}" MATCHES "arm"  OR  "${CMAKE_ASM_COMPILER}" MATCHES "arm")
+  set(CMAKE_EXECUTABLE_SUFFIX ".elf")
+
+  # For arm, IAR uses the "ilinkarm" linker and "iarchive" archiver:
+  find_program(CMAKE_IAR_LINKER ilinkarm HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}")
+  find_program(CMAKE_IAR_AR iarchive HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
+
+  set(IAR_TARGET_ARCHITECTURE "ARM" CACHE STRING "IAR compiler target architecture")
+endif()
+
+if("${CMAKE_C_COMPILER}" MATCHES "avr"  OR  "${CMAKE_CXX_COMPILER}" MATCHES "avr"  OR  "${CMAKE_ASM_COMPILER}" MATCHES "avr")
+  set(CMAKE_EXECUTABLE_SUFFIX ".bin")
+
+  # For AVR and AVR32, IAR uses the "xlink" linker and the "xar" archiver:
+  find_program(CMAKE_IAR_LINKER xlink HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
+  find_program(CMAKE_IAR_AR xar HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" )
+
+  set(IAR_TARGET_ARCHITECTURE "AVR" CACHE STRING "IAR compiler target architecture")
+
+  set(CMAKE_LIBRARY_PATH_FLAG "-I")
+
+endif()
+
+if(NOT IAR_TARGET_ARCHITECTURE)
+  message(FATAL_ERROR "The IAR compiler for this architecture is not yet supported "
+          " by CMake. Please go to http://www.cmake.org/Bug and enter a feature request there.")
+endif()
+
+set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
+set(CMAKE_AR "${CMAKE_IAR_AR}" CACHE FILEPATH "The IAR archiver" FORCE)

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

Summary of changes:
 Modules/CMakeCCompilerId.c.in           |    7 ++---
 Modules/CMakeCXXCompilerId.cpp.in       |    5 +++
 Modules/CMakeDetermineASMCompiler.cmake |    4 +++
 Modules/CMakeDetermineCCompiler.cmake   |    7 +++++
 Modules/CMakeDetermineCXXCompiler.cmake |    7 +++++
 Modules/Compiler/IAR-ASM.cmake          |   14 +++++++++
 Modules/Compiler/IAR-C.cmake            |   34 +++++++++++++++++++++++
 Modules/Compiler/IAR-CXX.cmake          |   34 +++++++++++++++++++++++
 Modules/Compiler/IAR.cmake              |   46 +++++++++++++++++++++++++++++++
 9 files changed, 154 insertions(+), 4 deletions(-)
 create mode 100644 Modules/Compiler/IAR-ASM.cmake
 create mode 100644 Modules/Compiler/IAR-C.cmake
 create mode 100644 Modules/Compiler/IAR-CXX.cmake
 create mode 100644 Modules/Compiler/IAR.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list