[Cmake-commits] [cmake-commits] hoffman committed CMakeCCompiler.cmake.in 1.22 1.23 CMakeCCompilerId.c.in 1.6 1.7 CMakeCXXCompiler.cmake.in 1.22 1.23 CMakeDetermineCCompiler.cmake 1.57 1.58 CMakeDetermineCXXCompiler.cmake 1.49 1.50 CMakeDetermineCompilerId.cmake 1.20 1.21 CMakePlatformId.h.in 1.3 1.4
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Nov 19 21:58:44 EST 2009
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv29303
Modified Files:
CMakeCCompiler.cmake.in CMakeCCompilerId.c.in
CMakeCXXCompiler.cmake.in CMakeDetermineCCompiler.cmake
CMakeDetermineCXXCompiler.cmake CMakeDetermineCompilerId.cmake
CMakePlatformId.h.in
Log Message:
Change the way 32/64 bit compiles are detected with MSVC and intel makefile builds. Use the platform ID preprocessor approach.
Index: CMakeDetermineCXXCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCXXCompiler.cmake,v
retrieving revision 1.49
retrieving revision 1.50
diff -C 2 -d -r1.49 -r1.50
*** CMakeDetermineCXXCompiler.cmake 28 Sep 2009 15:46:47 -0000 1.49
--- CMakeDetermineCXXCompiler.cmake 20 Nov 2009 02:58:42 -0000 1.50
***************
*** 177,181 ****
INCLUDE(CMakeFindBinUtils)
!
# configure all variables set in this file
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
--- 177,184 ----
INCLUDE(CMakeFindBinUtils)
! IF(MSVC_CXX_ARCHITECTURE_ID)
! SET(SET_MSVC_CXX_ARCHITECTURE_ID
! "SET(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
! ENDIF(MSVC_CXX_ARCHITECTURE_ID)
# configure all variables set in this file
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
Index: CMakeCXXCompiler.cmake.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCXXCompiler.cmake.in,v
retrieving revision 1.22
retrieving revision 1.23
diff -C 2 -d -r1.22 -r1.23
*** CMakeCXXCompiler.cmake.in 19 Sep 2009 14:14:29 -0000 1.22
--- CMakeCXXCompiler.cmake.in 20 Nov 2009 02:58:42 -0000 1.23
***************
*** 3,6 ****
--- 3,7 ----
SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
+ @SET_MSVC_CXX_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
Index: CMakeCCompiler.cmake.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCCompiler.cmake.in,v
retrieving revision 1.22
retrieving revision 1.23
diff -C 2 -d -r1.22 -r1.23
*** CMakeCCompiler.cmake.in 19 Sep 2009 14:14:29 -0000 1.22
--- CMakeCCompiler.cmake.in 20 Nov 2009 02:58:42 -0000 1.23
***************
*** 3,6 ****
--- 3,7 ----
SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
+ @SET_MSVC_C_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
Index: CMakePlatformId.h.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakePlatformId.h.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** CMakePlatformId.h.in 15 Sep 2008 21:53:27 -0000 1.3
--- CMakePlatformId.h.in 20 Nov 2009 02:58:42 -0000 1.4
***************
*** 83,86 ****
--- 83,107 ----
#endif
+ /* For windows compilers MSVC and Intel we can determine
+ the architecture of the compiler being used. This is becase
+ the compilers do not have flags that can change the architecture,
+ but rather depend on which compiler is being used
+ */
+ #if defined(_WIN32) && defined(_MSC_VER)
+ # if defined(_M_IA64)
+ # define ARCHITECTURE_ID "IA64"
+
+ # elif defined(_M_X64) || defined(_M_AMD64)
+ # define ARCHITECTURE_ID "x64"
+
+ # elif defined(_M_IX86)
+ # define ARCHITECTURE_ID "X86"
+
+ # else /* unknown architecture */
+ # defined ARCHITECTURE_ID ""
+ # endif
+
+ #endif
+
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
***************
*** 88,89 ****
--- 109,112 ----
array rather than assigning a pointer to a static array. */
char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
+ char* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
+
Index: CMakeDetermineCompilerId.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCompilerId.cmake,v
retrieving revision 1.20
retrieving revision 1.21
diff -C 2 -d -r1.20 -r1.21
*** CMakeDetermineCompilerId.cmake 28 Sep 2009 15:46:47 -0000 1.20
--- CMakeDetermineCompilerId.cmake 20 Nov 2009 02:58:42 -0000 1.21
***************
*** 58,61 ****
--- 58,63 ----
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
+ SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
+ PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
***************
*** 172,176 ****
SET(PLATFORM_ID)
FILE(STRINGS ${file}
! CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 2 REGEX "INFO:")
SET(HAVE_COMPILER_TWICE 0)
FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
--- 174,178 ----
SET(PLATFORM_ID)
FILE(STRINGS ${file}
! CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 3 REGEX "INFO:")
SET(HAVE_COMPILER_TWICE 0)
FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
***************
*** 186,189 ****
--- 188,195 ----
PLATFORM_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
+ IF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
+ STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
+ ARCHITECTURE_ID "${info}")
+ ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
ENDFOREACH(info)
***************
*** 192,195 ****
--- 198,202 ----
SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
+ SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
***************
*** 235,238 ****
--- 242,247 ----
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
+ SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
+ PARENT_SCOPE)
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
Index: CMakeCCompilerId.c.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeCCompilerId.c.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** CMakeCCompilerId.c.in 7 Aug 2009 14:13:02 -0000 1.6
--- CMakeCCompilerId.c.in 20 Nov 2009 02:58:42 -0000 1.7
***************
*** 94,97 ****
--- 94,98 ----
require += info_compiler[argc];
require += info_platform[argc];
+ require += info_arch[argc];
(void)argv;
return require;
Index: CMakeDetermineCCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCCompiler.cmake,v
retrieving revision 1.57
retrieving revision 1.58
diff -C 2 -d -r1.57 -r1.58
*** CMakeDetermineCCompiler.cmake 28 Sep 2009 15:46:46 -0000 1.57
--- CMakeDetermineCCompiler.cmake 20 Nov 2009 02:58:42 -0000 1.58
***************
*** 172,181 ****
INCLUDE(CMakeFindBinUtils)
!
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
! )
!
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
--- 172,183 ----
INCLUDE(CMakeFindBinUtils)
! IF(MSVC_C_ARCHITECTURE_ID)
! SET(SET_MSVC_C_ARCHITECTURE_ID
! "SET(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
! ENDIF(MSVC_C_ARCHITECTURE_ID)
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
! )
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
More information about the Cmake-commits
mailing list