summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2010-09-03 02:22:23 +0000
committerOscar Fuentes <ofv@wanadoo.es>2010-09-03 02:22:23 +0000
commite1967a742e1fcbb5fb525f87b8501e8f6e3ef878 (patch)
treebe41f8d118550944564441e7009bbf3efad384a3 /cmake
parent95f1e2d6b52d55773bca16a5d3b7b283344dc47d (diff)
downloadllvm-e1967a742e1fcbb5fb525f87b8501e8f6e3ef878.tar.gz
llvm-e1967a742e1fcbb5fb525f87b8501e8f6e3ef878.tar.bz2
llvm-e1967a742e1fcbb5fb525f87b8501e8f6e3ef878.tar.xz
Fix cmake build without native target selected.
The cmake (+ MSVC) build is broken if you don't select your native target. e.g. 'cmake -D LLVM_TARGETS_TO_BUILD="MyNonNativeTarget" .' This is because cmake currently sets the LLVM_NATIVE_* definitions regardless of whether the native target is selected (causing build errors). Patch by Mike Gist! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/config-ix.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 56e8d83736..f75e5dfb26 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -207,9 +207,6 @@ else ()
endif ()
if (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)
list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX)
if (NATIVE_ARCH_IDX EQUAL -1)
message(STATUS
@@ -217,6 +214,9 @@ if (LLVM_NATIVE_ARCH)
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()