Exemplo n.º 1
0
def build(bld):
    env = bld.env
    glob = wafmod.gbl.Global(bld)

    if bld.cmd == "install_headers":
        glob.installHeaders(env.sourceDir)
        return

    if not bld.variant:
        bld.fatal(
            'call "waf [build/install/clean]_[debug/release]", and try "waf --help"'
        )

    env.targetProjectPaths = os.environ.get("PROJECTS", None)

    bld.env.projectDir = bld.path.abspath()

    bld.GLOBAL = glob

    glob.setVariable(name="max_errors_flag",
                     value="-fmax-errors=" + ` env["errors.max"] `,
                     cond=glob.bld.getEnv("CXX") == "g++"
                     and env["errors.max"] != [])

    glob.setVariable(name="max_errors_flag",
                     value="-ferror-limit=" + ` env["errors.max"] `,
                     cond=glob.bld.getEnv("CXX") == "clang++"
                     and env["errors.max"] != [])

    qt5Home = env["qt5.home"]
    if glob.bld.getEnv("CXX") == "clang++":
        qt5Variant = "linux-clang"
    else:
        qt5Variant = "linux-gcc"

    if qt5Home != []:
        glob.setVariable(name  = "qt5.include",
                         value = "-I " + qt5Home + "/gcc_64/mkspecs/" + qt5Variant + " "\
                                 "-I " + qt5Home + "/gcc_64/include")

        glob.setVariable(name  = "qt5.lib",
                         value = "-L " + qt5Home + "/gcc_64/lib " + \
                                 "-L " + qt5Home + "/gcc_64 " + \
                                 "-lGL " + \
                                 "-Wl,-rpath," + qt5Home + "/gcc_64/lib " + \
                                 "-Wl,-rpath," + qt5Home + "/gcc_64")

    setVariables(glob)
    if env.targetProjectPaths:
        for path in env.targetProjectPaths.split():
            bld.recurse(path)

    addFGens(bld, env.sourceDir)
Exemplo n.º 2
0
def build(bld):
    env = bld.env
    glob = wafmod.gbl.Global(bld)

    if bld.cmd == "install_headers":
        glob.installHeaders(env.sourceDir)
        return

    if not bld.variant:
        bld.fatal('call "waf [build/install/clean]_[debug/release]", and try "waf --help"')


    env.targetProjectPaths = os.environ.get("PROJECTS", None)

    bld.env.projectDir = bld.path.abspath()

    bld.GLOBAL = glob

    glob.setVariable(name  = "max_errors_flag",
                     value = "-fmax-errors=" + `env["errors.max"]`,
                     cond  = glob.bld.getEnv("CXX") == "g++" and env["errors.max"] != [])

    glob.setVariable(name  = "max_errors_flag",
                     value = "-ferror-limit=" + `env["errors.max"]`,
                     cond  = glob.bld.getEnv("CXX") == "clang++" and env["errors.max"] != [])

    qt5Home = env["qt5.home"]
    if glob.bld.getEnv("CXX") == "clang++":
        qt5Variant = "linux-clang"
    else:
        qt5Variant = "linux-gcc"

    if qt5Home != []:
        glob.setVariable(name  = "qt5.include",
                         value = "-I " + qt5Home + "/gcc_64/mkspecs/" + qt5Variant + " "\
                                 "-I " + qt5Home + "/gcc_64/include")

        glob.setVariable(name  = "qt5.lib",
                         value = "-L " + qt5Home + "/gcc_64/lib " + \
                                 "-L " + qt5Home + "/gcc_64 " + \
                                 "-lGL " + \
                                 "-Wl,-rpath," + qt5Home + "/gcc_64/lib " + \
                                 "-Wl,-rpath," + qt5Home + "/gcc_64")
    
    setVariables(glob)
    if env.targetProjectPaths:
        for path in env.targetProjectPaths.split():
            bld.recurse(path)

    addFGens(bld, env.sourceDir)
Exemplo n.º 3
0
def setVariables(glob):
    env = glob.env

    glob.setVariable(name="comp_args.c", value="{CFLAGS}")

    glob.setVariable(name="comp_args.cxx",
                     value="{CXXFLAGS} -std=c++" + glob.env["cpp.version"] +
                     " -Wno-deprecated-register")

    glob.setVariable(
        name="global.comp_args",
        value=
        "-g -DBOOST_PP_VARIADICS=1 -fPIC {max_errors_flag} -Wreturn-type -Wno-mismatched-tags",
        cond=glob.bld.variant == 'debug')

    glob.setVariable(
        name="global.comp_args",
        value=
        "-O3 -DBOOST_PP_VARIADICS=1 -fPIC {max_errors_flag} -DNDEBUG -Wreturn-type",
        cond=glob.bld.variant == 'release')

    glob.setVariable(name="target.comp_args",
                     value="{global.comp_args}",
                     cond=glob.bld.variant == 'debug')

    glob.setVariable(name="target.comp_args",
                     value="{global.comp_args}",
                     cond=glob.bld.variant == 'release')

    glob.setVariable(name="target.link_args", value="{LDFLAGS} -fPIC")
Exemplo n.º 4
0
def setVariables(glob):
    env = glob.env

    glob.setVariable(name  = "comp_args.c",
                     value = "{CFLAGS}")

    glob.setVariable(name  = "comp_args.cxx",
                     value = "{CXXFLAGS} -std=c++" + glob.env["cpp.version"] + " -Wno-deprecated-register")

    glob.setVariable(name  = "global.comp_args",
                     value = "-g -DBOOST_PP_VARIADICS=1 -fPIC {max_errors_flag} -Wreturn-type -Wno-mismatched-tags",
                     cond  = glob.bld.variant == 'debug')

    glob.setVariable(name  = "global.comp_args",
                     value = "-O3 -DBOOST_PP_VARIADICS=1 -fPIC {max_errors_flag} -DNDEBUG -Wreturn-type",
                     cond  = glob.bld.variant == 'release')

    glob.setVariable(name  = "target.comp_args",
                     value = "{global.comp_args}",
                     cond  = glob.bld.variant == 'debug')

    glob.setVariable(name  = "target.comp_args",
                     value = "{global.comp_args}",
                     cond  = glob.bld.variant == 'release')

    glob.setVariable(name  = "target.link_args",
                     value = "{LDFLAGS} -fPIC")