mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-06 10:38:54 +00:00
CMake: New user-settable variable LLVM_TARGET_ARCH useful when
cross-compiling. Patch by Xerxes Rånby! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81722 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
422094c38d
commit
a9ff1392ea
@ -70,6 +70,9 @@ else( MSVC )
|
|||||||
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
|
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
|
||||||
endif( MSVC )
|
endif( MSVC )
|
||||||
|
|
||||||
|
set(LLVM_TARGET_ARCH "host"
|
||||||
|
CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.")
|
||||||
|
|
||||||
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
|
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
|
||||||
|
|
||||||
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
|
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
|
||||||
|
@ -92,13 +92,18 @@ get_target_triple(LLVM_HOSTTRIPLE)
|
|||||||
message(STATUS "LLVM_HOSTTRIPLE: ${LLVM_HOSTTRIPLE}")
|
message(STATUS "LLVM_HOSTTRIPLE: ${LLVM_HOSTTRIPLE}")
|
||||||
|
|
||||||
# Determine the native architecture.
|
# Determine the native architecture.
|
||||||
# FIXME: this will have to change for cross-compiling.
|
string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)
|
||||||
string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOSTTRIPLE})
|
if( LLVM_NATIVE_ARCH STREQUAL "host" )
|
||||||
|
string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOSTTRIPLE})
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86")
|
if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86")
|
||||||
set(LLVM_NATIVE_ARCH X86)
|
set(LLVM_NATIVE_ARCH X86)
|
||||||
elseif (LLVM_NATIVE_ARCH STREQUAL amd64)
|
elseif (LLVM_NATIVE_ARCH STREQUAL "x86")
|
||||||
set(LLVM_NATIVE_ARCH X86)
|
set(LLVM_NATIVE_ARCH X86)
|
||||||
elseif (LLVM_NATIVE_ARCH STREQUAL x86_64)
|
elseif (LLVM_NATIVE_ARCH STREQUAL "amd64")
|
||||||
|
set(LLVM_NATIVE_ARCH X86)
|
||||||
|
elseif (LLVM_NATIVE_ARCH STREQUAL "x86_64")
|
||||||
set(LLVM_NATIVE_ARCH X86)
|
set(LLVM_NATIVE_ARCH X86)
|
||||||
elseif (LLVM_NATIVE_ARCH MATCHES "sparc")
|
elseif (LLVM_NATIVE_ARCH MATCHES "sparc")
|
||||||
set(LLVM_NATIVE_ARCH Sparc)
|
set(LLVM_NATIVE_ARCH Sparc)
|
||||||
|
@ -273,6 +273,13 @@
|
|||||||
option is available only on some 64-bits unix systems. Defaults to
|
option is available only on some 64-bits unix systems. Defaults to
|
||||||
OFF.</dd>
|
OFF.</dd>
|
||||||
|
|
||||||
|
<dt><b>LLVM_TARGET_ARCH</b>:STRING</dt>
|
||||||
|
<dd>LLVM target to use for native code generation. This is required
|
||||||
|
for JIT generation. It defaults to "host", meaning that it shall
|
||||||
|
pick the architecture of the machine where LLVM is being built. If
|
||||||
|
you are cross-compiling, set it to the target architecture
|
||||||
|
name.</dd>
|
||||||
|
|
||||||
<dt><b>LLVM_TABLEGEN</b>:STRING</dt>
|
<dt><b>LLVM_TABLEGEN</b>:STRING</dt>
|
||||||
<dd>Full path to a native TableGen executable (usually
|
<dd>Full path to a native TableGen executable (usually
|
||||||
named <i>tblgen</i>). This is intented for cross-compiling: if the
|
named <i>tblgen</i>). This is intented for cross-compiling: if the
|
||||||
@ -311,6 +318,9 @@
|
|||||||
<a href="http://www.vtk.org/Wiki/CMake_Cross_Compiling#Information_how_to_set_up_various_cross_compiling_toolchains">this
|
<a href="http://www.vtk.org/Wiki/CMake_Cross_Compiling#Information_how_to_set_up_various_cross_compiling_toolchains">this
|
||||||
section</a> for a quick solution.</p>
|
section</a> for a quick solution.</p>
|
||||||
|
|
||||||
|
<p>Also see the <a href="#llvmvars">LLVM-specific variables</a>
|
||||||
|
section for variables used when cross-compiling.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- *********************************************************************** -->
|
<!-- *********************************************************************** -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user