Starting to refactor Target to separate out code that's needed to fully describe
[oota-llvm.git] / lib / Target / X86 / CMakeLists.txt
1 set(LLVM_TARGET_DEFINITIONS X86.td)
2
3 tablegen(X86GenRegisterNames.inc -gen-register-enums)
4 tablegen(X86GenRegisterDesc.inc -gen-register-desc)
5 tablegen(X86GenRegisterInfo.h.inc -gen-register-info-header)
6 tablegen(X86GenRegisterInfo.inc -gen-register-info)
7 tablegen(X86GenDisassemblerTables.inc -gen-disassembler)
8 tablegen(X86GenInstrNames.inc -gen-instr-enums)
9 tablegen(X86GenInstrInfo.inc -gen-instr-desc)
10 tablegen(X86GenAsmWriter.inc -gen-asm-writer)
11 tablegen(X86GenAsmWriter1.inc -gen-asm-writer -asmwriternum=1)
12 tablegen(X86GenAsmMatcher.inc -gen-asm-matcher)
13 tablegen(X86GenDAGISel.inc -gen-dag-isel)
14 tablegen(X86GenFastISel.inc -gen-fast-isel)
15 tablegen(X86GenCallingConv.inc -gen-callingconv)
16 tablegen(X86GenSubtarget.inc -gen-subtarget)
17 tablegen(X86GenEDInfo.inc -gen-enhanced-disassembly-info)
18
19 set(sources
20   SSEDomainFix.cpp
21   X86AsmBackend.cpp
22   X86AsmPrinter.cpp
23   X86COFFMachineModuleInfo.cpp
24   X86CodeEmitter.cpp
25   X86ELFWriterInfo.cpp
26   X86FastISel.cpp
27   X86FloatingPoint.cpp
28   X86FrameLowering.cpp
29   X86ISelDAGToDAG.cpp
30   X86ISelLowering.cpp
31   X86InstrInfo.cpp
32   X86JITInfo.cpp
33   X86MachObjectWriter.cpp
34   X86MCAsmInfo.cpp
35   X86MCCodeEmitter.cpp 
36   X86MCInstLower.cpp
37   X86RegisterInfo.cpp
38   X86SelectionDAGInfo.cpp
39   X86Subtarget.cpp
40   X86TargetMachine.cpp
41   X86TargetObjectFile.cpp
42   )
43
44 if( CMAKE_CL_64 )
45   # A workaround for a bug in cmake 2.8.3. See PR 8885.
46   if( CMAKE_VERSION STREQUAL "2.8.3" )
47     include(CMakeDetermineCompilerId)
48   endif()
49   # end of workaround.
50   enable_language(ASM_MASM)
51   ADD_CUSTOM_COMMAND(
52     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj
53     MAIN_DEPENDENCY X86CompilationCallback_Win64.asm
54     COMMAND ${CMAKE_ASM_MASM_COMPILER} /Fo ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj /c ${CMAKE_CURRENT_SOURCE_DIR}/X86CompilationCallback_Win64.asm
55    )
56    set(sources ${sources} ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj)
57 endif()
58
59 add_llvm_target(X86CodeGen ${sources})
60
61 add_subdirectory(AsmParser)
62 add_subdirectory(Disassembler)
63 add_subdirectory(InstPrinter)
64 add_subdirectory(TargetInfo)
65 add_subdirectory(Utils)