dark-hammer / src / engine / wscript

The branch '0.4.7' does not exist.
#! /usr/bin/env python

import os

def build(bld):
    env = bld.env.derive()
    files = [
    # components
    # lua
    ## physx

    env.prepend_value("INCLUDES", env.PHYSX_INCLUDEDIR)
    env.append_unique("LIBPATH", env.PHYSX_LIBDIR)
    if env.PLATFORM == "LINUX" or env.PLATFORM == "OSX":
        env.append_unique("LIB", [  "PhysX3Extensions",
    elif env.PLATFORM == "WIN":
        rel_suffix = ""
        if env.DEBUG:
            rel_suffix = "DEBUG"
        if env.DEST_CPU == "amd64" or env.DEST_CPU == "x86_64":
            arch_suffix = "_x64"
            arch_suffix = "_x86"
        env.append_unique("LIB", [  "PhysX3" + rel_suffix + arch_suffix,
                                    "PhysX3Common" + rel_suffix + arch_suffix,
                                    "PhysX3Extensions" + rel_suffix,
                                    "PhysXProfileSDK" + rel_suffix])
    # renderpaths
    ## graphics
    if env.GFX_DEVICE == "D3D":
        env.prepend_value("LIBPATH", env.DX_LIBDIR)
        env.prepend_value("INCLUDES", env.DX_INCLUDEDIR)
        env.append_unique("LIB", ["d3dcompiler", "dxguid", "d3d11", "dxgi"])
    elif env.GFX_DEVICE == "GL":
        if env.PLATFORM == "LINUX":
            env.append_unique("LIB", "GL")
        elif env.PLATFORM == "WIN":
            env.append_unique("LIB", "OpenGL32")
    # platform dependent sources
    if env.PLATFORM == "WIN":
    elif env.PLATFORM == "LINUX":
    elif env.PLATFORM == "OSX":
    # pymodule
    if bld.variant == 'pymodule':
        files.extend(['pybind/pyengine_wrap.c', 'pybind/pyalloc.c'])
        env.prepend_value('LIBPATH', env.PY_LIBDIR)
        env.prepend_value('INCLUDES', env.PY_INCLUDEDIR)

    ## Defines
    env.append_unique("DEFINES", "_ENGINE_EXPORT_")

    ## includes
    env.prepend_value("INCLUDES", os.path.abspath(env.ROOTDIR + "/include/engine"))   
    env.prepend_value("INCLUDES", os.path.abspath(env.ROOTDIR + "/3rdparty/include/lua"))
    ## general libs
    if env.PLATFORM == "LINUX":
        env.append_unique("LIB", "m")
        env.append_unique("LIB", ["X11", "Xi", "Xrandr", "Xxf86vm"])
        # env.append_unique("LIB", "stdc++")
    elif env.PLATFORM == "OSX":
        env.append_unique("FRAMEWORK", ["Cocoa", "CoreFoundation", "IOKit", "OpenGL"])
    elif env.PLATFORM == "WIN":
        dwarnings = "/wd597 /wd791"
        env.append_unique("CFLAGS", dwarnings.split())
        env.append_unique("CXXFLAGS", dwarnings.split())
        env.append_unique("LIB", ["Advapi32", "User32", "Gdi32"])
        env.append_unique("LINKFLAGS", [

    # additional pymodule installation
    targetname = 'dh_engine'
    installdir = '${BINDIR}'
    if bld.variant == 'pymodule':
        bld.install_files('${PYDIR}', 'pybind/')
        targetname = 'dheng'
        installdir = '${PYDIR}'
        if env.PLATFORM == 'LINUX':
            env.cxxshlib_PATTERN = ''
            env.cshlib_PATTERN = ''
        elif env.PLATFORM == 'WIN':
            env.cxxshlib_PATTERN = '_%s.pyd'
            env.cshlib_PATTERN = '_%s.pyd'

    # build
        source = files,
        name = "dh_engine",
        target = targetname + env.SUFFIX,
        install_path = installdir,
        env = env,
        use = [
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.