aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-10-14 14:14:25 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-10-14 14:14:25 +0200
commit0ec1fc9e114a2fb8fd0cbeee38669547f46804c8 (patch)
treed63bc70c3d4743cc8868f70f591d2da0645c9b76 /cmake
parentd3f52debc6c45d1f26bb9406207ebc5a8638a429 (diff)
bug #891: Determine sizeof(void*) via CMAKE variable instead of test program
Diffstat (limited to 'cmake')
-rw-r--r--cmake/EigenTesting.cmake18
1 files changed, 5 insertions, 13 deletions
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
index 65bb29413..3ed002a87 100644
--- a/cmake/EigenTesting.cmake
+++ b/cmake/EigenTesting.cmake
@@ -489,20 +489,12 @@ macro(ei_set_build_string)
endmacro(ei_set_build_string)
macro(ei_is_64bit_env VAR)
-
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
- "int main() { return (sizeof(int*) == 8 ? 1 : 0); }
- ")
- try_run(run_res compile_res
- ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
- RUN_OUTPUT_VARIABLE run_output)
-
- if(compile_res AND run_res)
- set(${VAR} ${run_res})
- elseif(CMAKE_CL_64)
- set(${VAR} 1)
- elseif("$ENV{Platform}" STREQUAL "X64") # nmake 64 bit
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(${VAR} 1)
+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(${VAR} 0)
+ else()
+ message(WARNING "Unsupported pointer size. Please contact the authors.")
endif()
endmacro(ei_is_64bit_env)