Skip to content
Snippets Groups Projects
Commit 136858bd authored by Boroondas Gupte (patch by Robin Cornelius)'s avatar Boroondas Gupte (patch by Robin Cornelius)
Browse files

VWR-20911 FIXED CMake build arch detection is inaccurate and incomplete

Robin Cornelius' patch from
http://jira.secondlife.com/secure/attachment/42801/SNOW-776+Don%27t+use+uname+for+build+arch+detection%2C+use+compiler.patch
applied without fuzz:

	patching file indra/cmake/Variables.cmake
	Hunk #1 succeeded at 52 (offset -2 lines).

Added entry in doc/contributions.txt.
No further changes other than that.
(transplanted from a9132a63e4739965d65ddd58a7be9eabe4321c2a)
parent 9ff04909
No related branches found
No related tags found
No related merge requests found
...@@ -563,6 +563,7 @@ Robin Cornelius ...@@ -563,6 +563,7 @@ Robin Cornelius
VWR-12758 VWR-12758
VWR-12763 VWR-12763
VWR-12995 VWR-12995
VWR-20911
Ryozu Kojima Ryozu Kojima
VWR-53 VWR-53
VWR-287 VWR-287
......
...@@ -54,19 +54,20 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ...@@ -54,19 +54,20 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON BOOl FORCE) set(LINUX ON BOOl FORCE)
# If someone has specified a word size, use that to determine the # If someone has specified a word size, use that to determine the
# architecture. Otherwise, let the architecture specify the word size. # architecture. Otherwise, let the compiler specify the word size.
# Using uname will break under chroots and other cross arch compiles. RC
if (WORD_SIZE EQUAL 32) if (WORD_SIZE EQUAL 32)
set(ARCH i686) set(ARCH i686)
elseif (WORD_SIZE EQUAL 64) elseif (WORD_SIZE EQUAL 64)
set(ARCH x86_64) set(ARCH x86_64)
else (WORD_SIZE EQUAL 32) else (WORD_SIZE EQUAL 32)
execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/ if(CMAKE_SIZEOF_VOID_P MATCHES 4)
OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) set(ARCH i686)
if (ARCH STREQUAL x86_64) set(WORD_SIZE 32)
set(WORD_SIZE 64) else(CMAKE_SIZEOF_VOID_P MATCHES 4)
else (ARCH STREQUAL x86_64) set(ARCH x86_64)
set(WORD_SIZE 32) set(WORD_SIZE 64)
endif (ARCH STREQUAL x86_64) endif(CMAKE_SIZEOF_VOID_P MATCHES 4)
endif (WORD_SIZE EQUAL 32) endif (WORD_SIZE EQUAL 32)
set(LL_ARCH ${ARCH}_linux) set(LL_ARCH ${ARCH}_linux)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment