Fix InitializeNativeTargetAsmParser in CMake builds by defining the
authorChandler Carruth <chandlerc@gmail.com>
Fri, 9 Dec 2011 03:31:58 +0000 (03:31 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 9 Dec 2011 03:31:58 +0000 (03:31 +0000)
appropriate macro. Patch by Alexey Prokhin. Fixes PR11498.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146239 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/config-ix.cmake

index a5077002fea685ced235d66bae9a23229ddc3ec0..88eaa74017528b7ea237bda0fc625879193a93e3 100755 (executable)
@@ -332,6 +332,11 @@ else ()
   set(LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo)
   set(LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC)
   set(LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter)
+
+  # We don't have an ASM parser for all architectures yet.
+  if (EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/CMakeLists.txt)
+    set(LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser)
+  endif ()
 endif ()
 
 if( MINGW )