[cmake-commits] alex committed CMakeDetermineCCompiler.cmake 1.39.2.1
1.39.2.2 CMakeDetermineCXXCompiler.cmake 1.34.2.1 1.34.2.2
CMakeCCompiler.cmake.in 1.14 1.14.2.1 CMakeCXXCompiler.cmake.in
1.13 1.13.2.1
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed May 2 11:56:46 EDT 2007
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv3081
Modified Files:
Tag: CMake-CrossCompileBasic
CMakeDetermineCCompiler.cmake CMakeDetermineCXXCompiler.cmake
CMakeCCompiler.cmake.in CMakeCXXCompiler.cmake.in
Log Message:
ENH: make it possible to set the object file extension independent from the
build platform at build time
Alex
Index: CMakeDetermineCXXCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCXXCompiler.cmake,v
retrieving revision 1.34.2.1
retrieving revision 1.34.2.2
diff -u -d -r1.34.2.1 -r1.34.2.2
--- CMakeDetermineCXXCompiler.cmake 1 May 2007 18:23:28 -0000 1.34.2.1
+++ CMakeDetermineCXXCompiler.cmake 2 May 2007 15:56:44 -0000 1.34.2.2
@@ -87,6 +87,17 @@
ENDIF(NOT CMAKE_RANLIB)
MARK_AS_ADVANCED(CMAKE_RANLIB)
+# some exotic compilers have different extensions (e.g. sdcc uses .rel)
+# so don't overwrite it if it has been already defined by the user
+IF(NOT CMAKE_CXX_OUTPUT_EXTENSION)
+ IF(UNIX)
+ SET(CMAKE_CXX_OUTPUT_EXTENSION .o)
+ ELSE(UNIX)
+ SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
+ ENDIF(UNIX)
+ENDIF(NOT CMAKE_CXX_OUTPUT_EXTENSION)
+
+
# This block was used before the compiler was identified by building a
# source file. Unless g++ crashes when building a small C++
# executable this should no longer be needed.
Index: CMakeCXXCompiler.cmake.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCXXCompiler.cmake.in,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -d -r1.13 -r1.13.2.1
--- CMakeCXXCompiler.cmake.in 28 Apr 2007 13:35:01 -0000 1.13
+++ CMakeCXXCompiler.cmake.in 2 May 2007 15:56:44 -0000 1.13.2.1
@@ -22,11 +22,8 @@
SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm)
SET(CMAKE_CXX_LINKER_PREFERENCE Prefered)
-IF(UNIX)
- SET(CMAKE_CXX_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
- SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+SET(CMAKE_CXX_OUTPUT_EXTENSION ${CMAKE_CXX_OUTPUT_EXTENSION})
+
# save the size of void* in case where cache is removed
# and the this file is still around
SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
Index: CMakeCCompiler.cmake.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCCompiler.cmake.in,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- CMakeCCompiler.cmake.in 28 Apr 2007 13:35:01 -0000 1.14
+++ CMakeCCompiler.cmake.in 2 May 2007 15:56:44 -0000 1.14.2.1
@@ -22,11 +22,8 @@
SET(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
SET(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_C_LINKER_PREFERENCE None)
-IF(UNIX)
- SET(CMAKE_C_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
- SET(CMAKE_C_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+SET(CMAKE_C_OUTPUT_EXTENSION ${CMAKE_C_OUTPUT_EXTENSION})
+
# save the size of void* in case where cache is removed
# and the this file is still around
SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
Index: CMakeDetermineCCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCCompiler.cmake,v
retrieving revision 1.39.2.1
retrieving revision 1.39.2.2
diff -u -d -r1.39.2.1 -r1.39.2.2
--- CMakeDetermineCCompiler.cmake 1 May 2007 18:23:28 -0000 1.39.2.1
+++ CMakeDetermineCCompiler.cmake 2 May 2007 15:56:44 -0000 1.39.2.2
@@ -87,6 +87,17 @@
ENDIF(NOT CMAKE_RANLIB)
MARK_AS_ADVANCED(CMAKE_RANLIB)
+# some exotic compilers have different extensions (e.g. sdcc uses .rel)
+# so don't overwrite it if it has been already defined by the user
+IF(NOT CMAKE_C_OUTPUT_EXTENSION)
+ IF(UNIX)
+ SET(CMAKE_C_OUTPUT_EXTENSION .o)
+ ELSE(UNIX)
+ SET(CMAKE_C_OUTPUT_EXTENSION .obj)
+ ENDIF(UNIX)
+ENDIF(NOT CMAKE_C_OUTPUT_EXTENSION)
+
+
# Build a small source file to identify the compiler.
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_C_COMPILER_ID_RUN 1)
More information about the Cmake-commits
mailing list