annotate premake.lua @ 571:cbd6c8073a32

Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 02 Sep 2008 23:10:12 +0200
parents 1c7220171d41
children 8a8ee1f6b268
rev   line source
lindquist@1 1 project.name = llvmdc
lindquist@1 2
lindquist@268 3 -- options
lindquist@295 4
lindquist@295 5 -- we always make vtables opaque, it simply kills performance...
lindquist@268 6 OPAQUE_VTBLS = 1
lindquist@295 7
lindquist@295 8 -- use of boehm gc
kamm@544 9 USE_BOEHM_GC = 0
kamm@544 10 if OS ~= "windows" then
kamm@544 11 addoption("enable-boehm-gc", "Enable use of the Boehm GC (broken!)")
lindquist@295 12
kamm@544 13 if options["enable-boehm-gc"] then
lindquist@295 14 USE_BOEHM_GC = 1
lindquist@295 15 end
lindquist@285 16 end
lindquist@268 17
tomas@571 18 -- are we on a Posix system?
tomas@571 19 POSIX = 1
tomas@571 20 if OS == "windows" then
tomas@571 21 POSIX = 0
tomas@571 22 end
tomas@571 23
lindquist@336 24 -- D version - don't change these !!!
lindquist@336 25 DMDV1 = "1"
lindquist@336 26
lindquist@268 27 -- idgen
lindquist@1 28 package = newpackage()
lindquist@1 29 package.name = "idgen"
lindquist@1 30 package.kind = "exe"
lindquist@1 31 package.language = "c++"
lindquist@1 32 package.files = { "dmd/idgen.c" }
lindquist@1 33 package.buildoptions = { "-x c++" }
lindquist@35 34 package.postbuildcommands = { "./idgen", "mv -f id.c id.h dmd" }
lindquist@336 35 package.defines = { "DMDV1="..DMDV1 }
lindquist@1 36
lindquist@268 37 -- impcnvgen
lindquist@1 38 package = newpackage()
lindquist@1 39 package.name = "impcnvgen"
lindquist@1 40 package.kind = "exe"
lindquist@1 41 package.language = "c++"
lindquist@1 42 package.files = { "dmd/impcnvgen.c" }
lindquist@1 43 package.buildoptions = { "-x c++" }
lindquist@35 44 package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c dmd" }
lindquist@336 45 package.defines = { "DMDV1="..DMDV1 }
lindquist@336 46
lindquist@268 47 -- llvmdc
lindquist@1 48 package = newpackage()
lindquist@35 49 package.bindir = "bin"
lindquist@1 50 package.name = "llvmdc"
lindquist@1 51 package.kind = "exe"
lindquist@1 52 package.language = "c++"
lindquist@136 53 package.files = { matchfiles("dmd/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") }
lindquist@366 54 package.excludes = { "dmd/idgen.c", "dmd/impcnvgen.c" }
lindquist@1 55 package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" }
lindquist@131 56 package.linkoptions = {
lindquist@131 57 -- long but it's faster than just 'all'
lindquist@237 58 "`llvm-config --libs core asmparser bitreader bitwriter linker support target transformutils scalaropts ipo instrumentation x86 powerpc`",
lindquist@193 59 "`llvm-config --ldflags`",
lindquist@131 60 }
lindquist@193 61 package.defines = {
lindquist@193 62 "IN_LLVM",
lindquist@193 63 "_DH",
lindquist@268 64 "OPAQUE_VTBLS="..OPAQUE_VTBLS,
lindquist@268 65 "USE_BOEHM_GC="..USE_BOEHM_GC,
lindquist@336 66 "DMDV1="..DMDV1,
tomas@571 67 "POSIX="..POSIX,
lindquist@193 68 }
lindquist@1 69 package.config.Release.defines = { "LLVMD_NO_LOGGER" }
lindquist@86 70 package.config.Debug.buildoptions = { "-g -O0" }
lindquist@1 71 --package.targetprefix = "llvm"
lindquist@4 72 package.includepaths = { ".", "dmd" }
lindquist@1 73 --package.postbuildcommands = { "cd runtime; ./build.sh; cd .." }
lindquist@268 74 if USE_BOEHM_GC == 1 then
lindquist@268 75 package.links = { "gc" }
lindquist@268 76 end