On Wednesday 27 January 2010, Yegor Yefremov wrote:
> Brad King wrote:
> > Yegor Yefremov wrote:
> >> O.K. Here are some lines of my CMakeLists.txt:
> >>
> >> set (CMAKE_C_COMPILER arm-linux-gcc)
> >> set (CMAKE_STRIP arm-linux-strip)

Oh, if you do that in CMakeLists.txt this is quite late. You should use a 
toolchain file as described in the wiki.

> >> message (STATUS "ABI ${CMAKE_C_COMPILER_ABI}")
> >>
> >> After running cmake I see only ABI as output and CMakeCache.txt doesn't
> >> contain CMAKE_C_COMPILER_ABI variable at all.
> >
> > It's in CMakeFiles/CMake*Compiler.cmake.  It works only after the
> > language is enabled by the project() or enable_language() command.
> > The compiler must be set before one of these commands runs.
>
> O.K. after I defined project language and placed set (CMAKE_C_COMPILER
> arm-linux-gcc) before project(foo C) I could get the proper compiler ABI.
> Looking forward for this feature to be included.

Please test the new attached patch again and let me know if there are issues.

Alex
Index: CMakeCompilerABI.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCompilerABI.h,v
retrieving revision 1.3
diff -b -u -p -r1.3 CMakeCompilerABI.h
--- CMakeCompilerABI.h	23 Jan 2008 22:53:18 -0000	1.3
+++ CMakeCompilerABI.h	27 Jan 2010 20:47:35 -0000
@@ -17,6 +17,24 @@ const char info_sizeof_dptr[] =  {
 # define ABI_ID "ELF N32"
 #elif defined(__sgi) && defined(_ABI64)
 # define ABI_ID "ELF 64"
+/* check for gcc for ARM, may support ARM EABI */
+#elif defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
+# define ABI_ID "ELF ARMEABI"
+#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__)
+# define ABI_ID "ELF ARM"
+#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__)
+# define ABI_ID "ELF ARM"
+/* Check for the IAR compilers, they also generate ELF files. 
+ * When called with --aeabi, they are EABI compatible, but I think we cannot
+ * test for this here. */
+#elif defined(__ICCARM__)
+# define ABI_ID "ELF ARM"
+/* The IAR AVR linker supports many output formats, also ELF, but I think we 
+ * cannot test for this here. */ 
+#elif defined(__ICCAVR__)
+# define ABI_ID "IAR AVR"
+#elif defined(__ICCAVR32__)
+# define ABI_ID "IAR AVR32"
 #elif defined(__ELF__)
 # define ABI_ID "ELF"
 #endif
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to