blob: f982316fc087d5d065a8954237f2b04eac4896b2 [file] [log] [blame]
Oscar Fuentes3d01fc72008-09-22 01:08:49 +00001add_llvm_library(LLVMTarget
Benjamin Kramerdbc130f2010-01-16 22:23:09 +00002 Mangler.cpp
Oscar Fuentes3d01fc72008-09-22 01:08:49 +00003 Target.cpp
Rafael Espindola89b93722010-12-10 07:39:47 +00004 TargetAsmInfo.cpp
Chris Lattner46dc5832010-01-22 01:58:44 +00005 TargetAsmLexer.cpp
Oscar Fuentes3d01fc72008-09-22 01:08:49 +00006 TargetData.cpp
Bruno Cardoso Lopesd00d4152009-06-11 22:13:00 +00007 TargetELFWriterInfo.cpp
Anton Korobeynikov7af6fad2011-01-10 12:39:23 +00008 TargetFrameLowering.cpp
Oscar Fuentes3d01fc72008-09-22 01:08:49 +00009 TargetInstrInfo.cpp
Ted Kremenekc55db822009-07-21 17:43:20 +000010 TargetIntrinsicInfo.cpp
Chris Lattnerce991202011-02-18 21:50:34 +000011 TargetLibraryInfo.cpp
Chris Lattnerf0144122009-07-28 03:13:23 +000012 TargetLoweringObjectFile.cpp
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000013 TargetMachine.cpp
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000014 TargetRegisterInfo.cpp
Evan Cheng5b1b44892011-07-01 21:01:15 +000015 TargetSubtargetInfo.cpp
Oscar Fuentes3d01fc72008-09-22 01:08:49 +000016 )
Oscar Fuentes6d857ca2011-02-18 22:06:14 +000017
18set(LLVM_ENUM_ASM_PRINTERS "")
19set(LLVM_ENUM_ASM_PARSERS "")
20set(LLVM_ENUM_DISASSEMBLERS "")
21foreach(t ${LLVM_TARGETS_TO_BUILD})
22 message(STATUS "Targeting ${t}")
23 add_subdirectory(${t})
Oscar Fuentes6d857ca2011-02-18 22:06:14 +000024 set( td ${LLVM_MAIN_SRC_DIR}/lib/Target/${t} )
25 file(GLOB asmp_file "${td}/*AsmPrinter.cpp")
26 if( asmp_file )
27 set(LLVM_ENUM_ASM_PRINTERS
28 "${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n")
29 endif()
Oscar Fuentes6d857ca2011-02-18 22:06:14 +000030 if( EXISTS ${td}/AsmParser/CMakeLists.txt )
Oscar Fuentes6d857ca2011-02-18 22:06:14 +000031 set(LLVM_ENUM_ASM_PARSERS
32 "${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n")
33 endif()
34 if( EXISTS ${td}/Disassembler/CMakeLists.txt )
Oscar Fuentes6d857ca2011-02-18 22:06:14 +000035 set(LLVM_ENUM_DISASSEMBLERS
36 "${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n")
37 endif()
Oscar Fuentes6d857ca2011-02-18 22:06:14 +000038endforeach(t)
39
40# Produce llvm/Config/AsmPrinters.def
41configure_file(
42 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
43 ${LLVM_BINARY_DIR}/include/llvm/Config/AsmPrinters.def
44 )
45
46# Produce llvm/Config/AsmParsers.def
47configure_file(
48 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmParsers.def.in
49 ${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def
50 )
51
52# Produce llvm/Config/Disassemblers.def
53configure_file(
54 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in
55 ${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def
56 )