view premake.lua @ 351:f273f5c58a9a trunk

[svn r372] Fixed extern(C++) handling now same as DMD, which is to treat it like extern(C). Fixed a problem in resolving struct types where the size of elements might not yet be known. Switched to using DMD size() instead of LLVM ABI size (TargetData).
author lindquist
date Mon, 14 Jul 2008 03:23:43 +0200
parents aaade6ded589
children 1d3026702f65
line wrap: on
line source

project.name = llvmdc

-- options

-- we always make vtables opaque, it simply kills performance...
OPAQUE_VTBLS = 1

-- use of boehm gc
if OS == "windows" then
    USE_BOEHM_GC = 0
else
    addoption("no-boehm", "Disable use of the Boehm GC")

    if options["no-boehm"] then
        USE_BOEHM_GC = 0
    else
        USE_BOEHM_GC = 1
    end
end

-- D version - don't change these !!!
DMDV1 = "1"

-- idgen
package = newpackage()
package.name = "idgen"
package.kind = "exe"
package.language = "c++"
package.files = { "dmd/idgen.c" }
package.buildoptions = { "-x c++" }
package.postbuildcommands = { "./idgen", "mv -f id.c id.h dmd" }
package.defines = { "DMDV1="..DMDV1 }

-- impcnvgen
package = newpackage()
package.name = "impcnvgen"
package.kind = "exe"
package.language = "c++"
package.files = { "dmd/impcnvgen.c" }
package.buildoptions = { "-x c++" }
package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c dmd" }
package.defines = { "DMDV1="..DMDV1 }

--md5
package = newpackage()
package.name = "md5"
package.kind = "lib"
package.language = "c"
package.files = { "dmd/md5.c" }

-- llvmdc
package = newpackage()
package.bindir = "bin"
package.name = "llvmdc"
package.kind = "exe"
package.language = "c++"
package.files = { matchfiles("dmd/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") }
package.excludes = { "dmd/idgen.c", "dmd/impcnvgen.c", "dmd/md5.c" }
package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" }
package.linkoptions = {
    -- long but it's faster than just 'all'
    "`llvm-config --libs core asmparser bitreader bitwriter linker support target transformutils scalaropts ipo instrumentation x86 powerpc`",
    "`llvm-config --ldflags`",
}
package.defines = {
    "IN_LLVM",
    "_DH",
    "OPAQUE_VTBLS="..OPAQUE_VTBLS,
    "USE_BOEHM_GC="..USE_BOEHM_GC,
    "DMDV1="..DMDV1,
}
package.config.Release.defines = { "LLVMD_NO_LOGGER" }
package.config.Debug.buildoptions = { "-g -O0" }
--package.targetprefix = "llvm"
package.includepaths = { ".", "dmd" }
--package.postbuildcommands = { "cd runtime; ./build.sh; cd .." }
if USE_BOEHM_GC == 1 then
    package.links = { "gc" }
end