annotate CMakeLists.txt @ 749:db2dd9861600

Add basic CMake build file.
author Christian Kamm <kamm incasoftware de>
date Sun, 02 Nov 2008 21:47:31 +0100
parents
children d05fc504a3a0
rev   line source
kamm@749 1 project (ldc)
kamm@749 2
kamm@749 3 set (LDC_SOURCE_FILES
kamm@749 4 dmd/access.c
kamm@749 5 dmd/array.c
kamm@749 6 dmd/arrayop.c
kamm@749 7 dmd/attrib.c
kamm@749 8 dmd/cast.c
kamm@749 9 dmd/class.c
kamm@749 10 dmd/clone.c
kamm@749 11 dmd/cond.c
kamm@749 12 dmd/constfold.c
kamm@749 13 dmd/dchar.c
kamm@749 14 dmd/declaration.c
kamm@749 15 dmd/delegatize.c
kamm@749 16 dmd/doc.c
kamm@749 17 dmd/dsymbol.c
kamm@749 18 dmd/dump.c
kamm@749 19 dmd/entity.c
kamm@749 20 dmd/enum.c
kamm@749 21 dmd/expression.c
kamm@749 22 dmd/func.c
kamm@749 23 dmd/gnuc.c
kamm@749 24 dmd/hdrgen.c
kamm@749 25 dmd/html.c
kamm@749 26 dmd/id.c
kamm@749 27 dmd/identifier.c
kamm@749 28 dmd/impcnvtab.c
kamm@749 29 dmd/import.c
kamm@749 30 dmd/inifile.c
kamm@749 31 dmd/init.c
kamm@749 32 dmd/inline.c
kamm@749 33 dmd/interpret.c
kamm@749 34 dmd/lexer.c
kamm@749 35 dmd/lstring.c
kamm@749 36 dmd/macro.c
kamm@749 37 dmd/man.c
kamm@749 38 dmd/mangle.c
kamm@749 39 dmd/mars.c
kamm@749 40 dmd/mem.c
kamm@749 41 dmd/module.c
kamm@749 42 dmd/mtype.c
kamm@749 43 dmd/opover.c
kamm@749 44 dmd/optimize.c
kamm@749 45 dmd/parse.c
kamm@749 46 dmd/root.c
kamm@749 47 dmd/scope.c
kamm@749 48 dmd/statement.c
kamm@749 49 dmd/staticassert.c
kamm@749 50 dmd/stringtable.c
kamm@749 51 dmd/struct.c
kamm@749 52 dmd/template.c
kamm@749 53 dmd/unialpha.c
kamm@749 54 dmd/utf.c
kamm@749 55 dmd/version.c
kamm@749 56 gen/aa.cpp
kamm@749 57 gen/arrays.cpp
kamm@749 58 gen/asmstmt.cpp
kamm@749 59 gen/binops.cpp
kamm@749 60 gen/classes.cpp
kamm@749 61 gen/complex.cpp
kamm@749 62 gen/dvalue.cpp
kamm@749 63 gen/dwarftypes.cpp
kamm@749 64 gen/functions.cpp
kamm@749 65 gen/irstate.cpp
kamm@749 66 gen/linker.cpp
kamm@749 67 gen/llvmhelpers.cpp
kamm@749 68 gen/logger.cpp
kamm@749 69 gen/optimizer.cpp
kamm@749 70 gen/runtime.cpp
kamm@749 71 gen/statements.cpp
kamm@749 72 gen/structs.cpp
kamm@749 73 gen/tocall.cpp
kamm@749 74 gen/tocsym.cpp
kamm@749 75 gen/todebug.cpp
kamm@749 76 gen/todt.cpp
kamm@749 77 gen/toir.cpp
kamm@749 78 gen/tollvm.cpp
kamm@749 79 gen/toobj.cpp
kamm@749 80 gen/typinf.cpp
kamm@749 81 ir/irfunction.cpp
kamm@749 82 ir/irlandingpad.cpp
kamm@749 83 ir/irmodule.cpp
kamm@749 84 ir/irstruct.cpp
kamm@749 85 ir/irsymbol.cpp
kamm@749 86 ir/irtype.cpp
kamm@749 87 ir/irvar.cpp)
kamm@749 88
kamm@749 89 add_executable (ldc ${LDC_SOURCE_FILES})
kamm@749 90 set_source_files_properties (${LDC_SOURCE_FILES} PROPERTIES LANGUAGE CXX)
kamm@749 91
kamm@749 92 execute_process (COMMAND llvm-config --cxxflags OUTPUT_VARIABLE LLVM_CXXFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
kamm@749 93 #execute_process (COMMAND llvm-config --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIR)
kamm@749 94 #execute_process (COMMAND llvm-config --libs bitwriter linker ipo instrumentation backend OUTPUT_VARIABLE LLVM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
kamm@749 95 execute_process (COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/config.guess OUTPUT_VARIABLE DEFAULT_TRIPLE OUTPUT_STRIP_TRAILING_WHITESPACE)
kamm@749 96
kamm@749 97 set (LDC_DEFINES
kamm@749 98 -DIN_LLVM
kamm@749 99 -D_DH
kamm@749 100 -DOPAQUE_VTBLS
kamm@749 101 -DUSE_BOEHM_GC=0
kamm@749 102 -DDMDV1
kamm@749 103 -DPOSIX=1
kamm@749 104 -DDEFAULT_TARGET_TRIPLE=\\"${DEFAULT_TRIPLE}\\"
kamm@749 105 -DX86_REVERSE_PARAMS=1
kamm@749 106 -DX86_PASS_IN_EAX=1)
kamm@749 107
kamm@749 108 # passing CXXFLAGS here is not good style
kamm@749 109 add_definitions (${LDC_DEFINES} ${LLVM_CXXFLAGS})
kamm@749 110 include_directories (. dmd)
kamm@749 111
kamm@749 112 # this is hackish, but works
kamm@749 113 target_link_libraries (ldc "`llvm-config --ldflags` `llvm-config --libs bitwriter linker ipo instrumentation backend`")
kamm@749 114
kamm@749 115 #TODO: POSIX detection, runtime build