waifulib: update some modules, so they can be located inside waf binary or outside, in waifulib directory
This commit is contained in:
parent
d70a86cf7a
commit
a741514db4
@ -11,7 +11,8 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
from fwgslib import get_flags_by_compiler
|
||||
try: from fwgslib import get_flags_by_compiler
|
||||
except: from waflib.extras.fwgslib import get_flags_by_compiler
|
||||
|
||||
# Input:
|
||||
# CXX11_MANDATORY(optional) -- fail if C++11 not available
|
||||
|
@ -11,7 +11,8 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
from fwgslib import get_flags_by_compiler
|
||||
try: from fwgslib import get_flags_by_compiler
|
||||
except: from waflib.extras.fwgslib import get_flags_by_compiler
|
||||
|
||||
# Input:
|
||||
# BIT32_MANDATORY(optional) -- fail if 32bit mode not available
|
||||
|
@ -1,5 +1,5 @@
|
||||
# encoding: utf-8
|
||||
# fwgslib.py -- utils for Waf build system by FWGS
|
||||
# fwgslib.py -- utils for Waifu build system(Waf with extensions) by FWGS
|
||||
# Copyright (C) 2018 a1batross, Michel Mooij (michel.mooij
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -12,7 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
import os
|
||||
from waflib import Utils, Errors
|
||||
from waflib import Utils, Errors, Configure, Build
|
||||
|
||||
def get_flags_by_compiler(flags, compiler):
|
||||
'''Returns a list of compile flags, depending on compiler
|
||||
@ -47,6 +47,20 @@ def get_flags_by_type(flags, type, compiler):
|
||||
out += get_flags_by_compiler(flags[type], compiler)
|
||||
return out
|
||||
|
||||
def conf_get_flags_by_compiler(unused, flags, compiler):
|
||||
return get_flags_by_compiler(flags, compiler)
|
||||
|
||||
setattr(Configure.ConfigurationContext, 'get_flags_by_compiler', conf_get_flags_by_compiler)
|
||||
setattr(Build.BuildContext, 'get_flags_by_compiler', conf_get_flags_by_compiler)
|
||||
|
||||
def conf_get_flags_by_type(unused, flags, type, compiler):
|
||||
return get_flags_by_type(flags, type, compiler)
|
||||
|
||||
setattr(Configure.ConfigurationContext, 'get_flags_by_type', conf_get_flags_by_type)
|
||||
setattr(Build.BuildContext, 'get_flags_by_type', conf_get_flags_by_type)
|
||||
|
||||
|
||||
|
||||
def get_deps(bld, target):
|
||||
'''Returns a list of (nested) targets on which this target depends.
|
||||
|
||||
|
@ -106,8 +106,11 @@ from waflib import Utils, Logs, Errors, Context
|
||||
from waflib.Build import BuildContext
|
||||
# import waftools
|
||||
# from waftools import deps
|
||||
from fwgslib import get_targets
|
||||
from subproject import get_subproject_env
|
||||
try: from fwgslib import get_targets
|
||||
except: from waflib.extras.fwgslib import get_targets
|
||||
|
||||
try: from subproject import get_subproject_env
|
||||
except from waflib.extras.subproject import get_subproject_env
|
||||
|
||||
|
||||
def options(opt):
|
||||
|
@ -11,7 +11,8 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
from fwgslib import get_flags_by_compiler
|
||||
try: from fwgslib import get_flags_by_compiler
|
||||
except: from waflib.extras.fwgslib import get_flags_by_compiler
|
||||
from waflib import Logs
|
||||
import os
|
||||
import sys
|
||||
|
Loading…
Reference in New Issue
Block a user