[llvm-commits] [llvm] r128154 - in /llvm/trunk: CMakeLists.txt cmake/config-ix.cmake cmake/modules/LLVMConfig.cmake
Oscar Fuentes
ofv at wanadoo.es
Wed Mar 23 10:42:13 PDT 2011
Author: ofv
Date: Wed Mar 23 12:42:13 2011
New Revision: 128154
URL: http://llvm.org/viewvc/llvm-project?rev=128154&view=rev
Log:
Supports building with a list of targets that does not contain
X86. Fixes PR9533.
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/config-ix.cmake
llvm/trunk/cmake/modules/LLVMConfig.cmake
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=128154&r1=128153&r2=128154&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Wed Mar 23 12:42:13 2011
@@ -81,6 +81,9 @@
XCore
)
+# List of targets with JIT support:
+set(LLVM_TARGETS_WITH_JIT X86 PowerPC ARM)
+
if( MSVC )
set(LLVM_TARGETS_TO_BUILD X86
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=128154&r1=128153&r2=128154&view=diff
==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Wed Mar 23 12:42:13 2011
@@ -321,24 +321,19 @@
elseif (LLVM_NATIVE_ARCH MATCHES "msp430")
set(LLVM_NATIVE_ARCH MSP430)
else ()
- message(STATUS
- "Unknown architecture ${LLVM_NATIVE_ARCH}; lli will not JIT code")
- set(LLVM_NATIVE_ARCH)
+ message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
endif ()
-if (LLVM_NATIVE_ARCH)
- list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX)
- if (NATIVE_ARCH_IDX EQUAL -1)
- message(STATUS
- "Native target ${LLVM_NATIVE_ARCH} is not selected; lli will not JIT code")
- set(LLVM_NATIVE_ARCH)
- else ()
- message(STATUS "Native target architecture is ${LLVM_NATIVE_ARCH}")
- set(LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target)
- set(LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo)
- set(LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter)
- endif ()
-endif()
+list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX)
+if (NATIVE_ARCH_IDX EQUAL -1)
+ message(STATUS
+ "Native target ${LLVM_NATIVE_ARCH} is not selected; lli will not JIT code")
+else ()
+ message(STATUS "Native target architecture is ${LLVM_NATIVE_ARCH}")
+ set(LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target)
+ set(LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo)
+ set(LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter)
+endif ()
if( MINGW )
set(HAVE_LIBIMAGEHLP 1)
Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake?rev=128154&r1=128153&r2=128154&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMConfig.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMConfig.cmake Wed Mar 23 12:42:13 2011
@@ -64,15 +64,22 @@
string(TOUPPER "${llvm_libs}" capitalized_libs)
# Expand some keywords:
+ list(FIND LLVM_TARGETS_TO_BUILD "${LLVM_NATIVE_ARCH}" have_native_backend)
list(FIND link_components "engine" engine_required)
- if( NOT engine_required STREQUAL "-1" )
- # TODO: as we assume we are on X86, this is `jit'.
- list(APPEND link_components "jit")
- list(APPEND link_components "native")
+ if( NOT engine_required EQUAL -1 )
+ list(FIND LLVM_TARGETS_WITH_JIT "${LLVM_NATIVE_ARCH}" have_jit)
+ if( NOT have_native_backend EQUAL -1 AND NOT have_jit EQUAL -1 )
+ list(APPEND link_components "jit")
+ list(APPEND link_components "native")
+ else()
+ list(APPEND link_components "interpreter")
+ endif()
endif()
list(FIND link_components "native" native_required)
- if( NOT native_required STREQUAL "-1" )
- list(APPEND link_components "X86")
+ if( NOT native_required EQUAL -1 )
+ if( NOT have_native_backend EQUAL -1 )
+ list(APPEND link_components ${LLVM_NATIVE_ARCH})
+ endif()
endif()
# Translate symbolic component names to real libraries:
More information about the llvm-commits
mailing list