aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSebastian Pop <spop@codeaurora.org>2012-08-08 17:45:43 +0000
committerSebastian Pop <spop@codeaurora.org>2012-08-08 17:45:43 +0000
commit6174fd7ed09e9d183d84fb3485a714c5b0c67e4a (patch)
treeedd9d0759bc7c8d976e7c8e4aa6f20a6d02a469b /cmake
parent8a403d326e7cb7e7ad6c0108d9e48b3e6ca47997 (diff)
enable Hexagon target from cmake
This patch allows us to use cmake to specify a cross compiler for Hexagon. In particular, the patch adds a missing case for the target Hexagon in cmake/config-ix.cmake, and it moves LLVM_DEFAULT_TARGET_TRIPLE and TARGET_TRIPLE variables from cmake/config-ix.cmake to the toplevel CMakeLists.txt to make them available at configure time. Here is the command line that I have used to test my patches: $ cmake -G Ninja -D BUILD_SHARED_LIBS:BOOL=ON -D LLVM_TARGETS_TO_BUILD:STRING=Hexagon -D TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_DEFAULT_TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_TARGET_ARCH:STRING=hexagon-unknown-linux-gnu -D LLVM_ENABLE_PIC:BOOL=OFF .. $ ninja check git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/config-ix.cmake7
1 files changed, 2 insertions, 5 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 25d6211ac6..1fe009fb07 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -291,12 +291,7 @@ check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
include(GetHostTriple)
get_host_triple(LLVM_HOST_TRIPLE)
-
-# By default, we target the host, but this can be overridden at CMake
-# invocation time.
-set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_HOST_TRIPLE}")
set(LLVM_HOSTTRIPLE "${LLVM_HOST_TRIPLE}")
-set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
# Determine the native architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)
@@ -324,6 +319,8 @@ elseif (LLVM_NATIVE_ARCH MATCHES "xcore")
set(LLVM_NATIVE_ARCH XCore)
elseif (LLVM_NATIVE_ARCH MATCHES "msp430")
set(LLVM_NATIVE_ARCH MSP430)
+elseif (LLVM_NATIVE_ARCH MATCHES "hexagon")
+ set(LLVM_NATIVE_ARCH Hexagon)
else ()
message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
endif ()