summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeCCompiler.cmake.in4
-rw-r--r--Modules/CMakeTestCCompiler.cmake6
2 files changed, 9 insertions, 1 deletions
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 9dc9737..dcd8054 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -25,4 +25,6 @@ IF(UNIX)
ELSE(UNIX)
SET(CMAKE_C_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
-
+# 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@)
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index f9aee68..096c790 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -36,4 +36,10 @@ ELSE(NOT CMAKE_C_COMPILER_WORKS)
# Check the size of void*. This used to be "void *" but icc expands the *.
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
+ # re-configure this file CMakeCCompiler.cmake so that it gets
+ # the value for CMAKE_SIZEOF_VOID_P
+ # configure variables set in this file for fast reload later on
+ CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
+ ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeCCompiler.cmake IMMEDIATE)
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
+