Build system infrastructure for multiple tblgens.
[oota-llvm.git] / lib / Target / X86 / CMakeLists.txt
1 set(LLVM_TARGET_DEFINITIONS X86.td)
2
3 llvm_tablegen(X86GenRegisterInfo.inc -gen-register-info)
4 llvm_tablegen(X86GenDisassemblerTables.inc -gen-disassembler)
5 llvm_tablegen(X86GenInstrInfo.inc -gen-instr-info)
6 llvm_tablegen(X86GenAsmWriter.inc -gen-asm-writer)
7 llvm_tablegen(X86GenAsmWriter1.inc -gen-asm-writer -asmwriternum=1)
8 llvm_tablegen(X86GenAsmMatcher.inc -gen-asm-matcher)
9 llvm_tablegen(X86GenDAGISel.inc -gen-dag-isel)
10 llvm_tablegen(X86GenFastISel.inc -gen-fast-isel)
11 llvm_tablegen(X86GenCallingConv.inc -gen-callingconv)
12 llvm_tablegen(X86GenSubtargetInfo.inc -gen-subtarget)
13 llvm_tablegen(X86GenEDInfo.inc -gen-enhanced-disassembly-info)
14 add_public_tablegen_target(X86CommonTableGen)
15
16 set(sources
17   X86AsmPrinter.cpp
18   X86COFFMachineModuleInfo.cpp
19   X86CodeEmitter.cpp
20   X86ELFWriterInfo.cpp
21   X86FastISel.cpp
22   X86FloatingPoint.cpp
23   X86FrameLowering.cpp
24   X86ISelDAGToDAG.cpp
25   X86ISelLowering.cpp
26   X86InstrInfo.cpp
27   X86JITInfo.cpp
28   X86MCInstLower.cpp
29   X86RegisterInfo.cpp
30   X86SelectionDAGInfo.cpp
31   X86Subtarget.cpp
32   X86TargetMachine.cpp
33   X86TargetObjectFile.cpp
34   X86VZeroUpper.cpp
35   )
36
37 if( CMAKE_CL_64 )
38   # A workaround for a bug in cmake 2.8.3. See PR 8885.
39   if( CMAKE_VERSION STREQUAL "2.8.3" )
40     include(CMakeDetermineCompilerId)
41   endif()
42   # end of workaround.
43   enable_language(ASM_MASM)
44   ADD_CUSTOM_COMMAND(
45     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj
46     MAIN_DEPENDENCY X86CompilationCallback_Win64.asm
47     COMMAND ${CMAKE_ASM_MASM_COMPILER} /Fo ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj /c ${CMAKE_CURRENT_SOURCE_DIR}/X86CompilationCallback_Win64.asm
48    )
49    set(sources ${sources} ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj)
50 endif()
51
52 add_llvm_target(X86CodeGen ${sources})
53
54 add_llvm_library_dependencies(LLVMX86CodeGen
55   LLVMAnalysis
56   LLVMAsmPrinter
57   LLVMCodeGen
58   LLVMCore
59   LLVMMC
60   LLVMSelectionDAG
61   LLVMSupport
62   LLVMTarget
63   LLVMX86AsmPrinter
64   LLVMX86Desc
65   )
66
67 add_subdirectory(AsmParser)
68 add_subdirectory(Disassembler)
69 add_subdirectory(InstPrinter)
70 add_subdirectory(MCTargetDesc)
71 add_subdirectory(TargetInfo)
72 add_subdirectory(Utils)