From e648d691275c23ed7935963052255cd44d738499 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Apr 2019 13:49:56 +0200 Subject: Squashed 'waflib/' changes from b074a1e..4f98e1c 4f98e1c Remove recursion hacks 27c5c93 Remove use_lib() git-subtree-dir: waflib git-subtree-split: 4f98e1c2bed7beacf4d303e51f994fb932952f95 --- extras/autowaf.py | 68 ++++++++++++++++--------------------------------------- 1 file changed, 19 insertions(+), 49 deletions(-) (limited to 'extras/autowaf.py') diff --git a/extras/autowaf.py b/extras/autowaf.py index 8c6e258..870a69a 100644 --- a/extras/autowaf.py +++ b/extras/autowaf.py @@ -7,9 +7,6 @@ import time from waflib import Configure, ConfigSet, Build, Context, Logs, Options, Utils from waflib.TaskGen import feature, before, after -global g_is_child -g_is_child = False - NONEMPTY = -10 if sys.platform == 'win32': @@ -454,26 +451,6 @@ def append_property(obj, key, val): else: setattr(obj, key, val) -def use_lib(bld, obj, libs): - abssrcdir = os.path.abspath('.') - libs_list = libs.split() - for l in libs_list: - in_headers = l.lower() in bld.env['AUTOWAF_LOCAL_HEADERS'] - in_libs = l.lower() in bld.env['AUTOWAF_LOCAL_LIBS'] - if in_libs: - append_property(obj, 'use', ' lib%s ' % l.lower()) - append_property(obj, 'framework', bld.env['FRAMEWORK_' + l]) - if in_headers or in_libs: - if bld.env.MSVC_COMPILER: - inc_flag = '/I' + os.path.join(abssrcdir, l.lower()) - else: - inc_flag = '-iquote ' + os.path.join(abssrcdir, l.lower()) - for f in ['CFLAGS', 'CXXFLAGS']: - if inc_flag not in bld.env[f]: - bld.env.prepend_value(f, inc_flag) - else: - append_property(obj, 'uselib', ' ' + l) - @feature('c', 'cxx') @before('apply_link') def version_lib(self): @@ -484,22 +461,34 @@ def version_lib(self): if [x for x in applicable if x in self.features]: self.target = self.target + 'D' -def set_lib_env(conf, name, version, has_objects=True): +def set_lib_env(conf, + name, + version, + has_objects=True, + include_path=None, + lib_path=None): "Set up environment for local library as if found via pkg-config." NAME = name.upper() major_ver = version.split('.')[0] pkg_var_name = 'PKG_' + name.replace('-', '_') + '_' + major_ver lib_name = '%s-%s' % (name, major_ver) - lib_path = [str(conf.path.get_bld())] + + if lib_path is None: + lib_path = str(conf.path.get_bld()) + + if include_path is None: + include_path = str(conf.path) + if conf.env.PARDEBUG: lib_name += 'D' + conf.env[pkg_var_name] = lib_name - conf.env['INCLUDES_' + NAME] = ['${INCLUDEDIR}/%s-%s' % (name, major_ver)] - conf.env['LIBPATH_' + NAME] = lib_path + conf.env['INCLUDES_' + NAME] = [include_path] + conf.env['LIBPATH_' + NAME] = [lib_path] if has_objects: conf.env['LIB_' + NAME] = [lib_name] - conf.run_env.append_unique(lib_path_name, lib_path) + conf.run_env.append_unique(lib_path_name, [lib_path]) conf.define(NAME + '_VERSION', version) def display_msg(conf, msg, status=None, color=None): @@ -526,14 +515,6 @@ def compile_flags(env, lib): return ' '.join(map(lambda x: env['CPPPATH_ST'] % x, env['INCLUDES_' + lib])) -def set_recursive(): - global g_is_child - g_is_child = True - -def is_child(): - global g_is_child - return g_is_child - def build_pc(bld, name, version, version_suffix, libs, subst_dict={}): """Build a pkg-config file for a library. @@ -588,13 +569,6 @@ def build_pc(bld, name, version, version_suffix, libs, subst_dict={}): obj.__dict__.update(subst_dict) -def build_dir(name, subdir): - if is_child(): - return os.path.join('build', name, subdir) - else: - return os.path.join('build', subdir) - - def make_simple_dox(name): "Clean up messy Doxygen documentation after it is built" name = name.lower() @@ -641,12 +615,8 @@ def build_dox(bld, name, version, srcdir, blddir, outdir='', versioned=True): if not bld.env['DOCS']: return - # Doxygen paths in are relative to the doxygen file, not build directory - if is_child(): - src_dir = os.path.join(srcdir, name.lower()) - else: - src_dir = srcdir - + # Doxygen paths in are relative to the doxygen file + src_dir = bld.path.srcpath() subst_tg = bld(features='subst', source='doc/reference.doxygen.in', target='doc/reference.doxygen', -- cgit v1.2.1