diff --git a/playground/boost/waf.bat b/playground/boost/waf.bat index ec97c98f..a96f2f84 100644 --- a/playground/boost/waf.bat +++ b/playground/boost/waf.bat @@ -1,3 +1,10 @@ @echo off + rem path are automatically detected on Linux -python waf --boost-includes=c:\boost_1_45_0 --boost-libs=c:\boost_1_45_0\stage\lib %1 %2 %3 +set BOOST_PATH=e:\project\libs\boost_1_55_0 +set BOOST_LIB=%BOOST_PATH%\lib32-msvc-12.0 + +set LIB=%BOOST_LIB% +set INCLUDE=%BOOST_PATH% + +python waf --boost-linkage_autodetect --boost-python=27 %* diff --git a/playground/boost/wscript b/playground/boost/wscript index e15fa8e8..16b9c39a 100644 --- a/playground/boost/wscript +++ b/playground/boost/wscript @@ -6,7 +6,7 @@ def options(opt): def configure(conf): conf.load('compiler_cxx boost') - conf.check_boost('system filesystem', mt=True) + conf.check_boost('system filesystem python', mt=True) def build(bld): bld.program(source='main.cpp', target='app', use='BOOST') diff --git a/waflib/extras/boost.py b/waflib/extras/boost.py index 543e0aa3..20e0ac22 100644 --- a/waflib/extras/boost.py +++ b/waflib/extras/boost.py @@ -229,6 +229,7 @@ def boost_get_libs(self, *k, **kw): according to the parameters ''' path, files = self.__boost_get_libs_path(**kw) + files = sorted(files, key=lambda f: len(f.name), reverse=True) toolset = self.boost_get_toolset(kw.get('toolset', '')) toolset_pat = '(-%s[0-9]{0,3})' % toolset version = '(-%s)' % self.env.BOOST_VERSION @@ -260,7 +261,10 @@ def boost_get_libs(self, *k, **kw): tags_pat = t and ''.join(t) or '' for lib in lib_names: if lib == 'python': - tags = '%s?(-py%s)?' % (tags_pat, kw['python']) + # for instance, with python='27', + # accepts '-py27', '-py2', '27' and '2' + # but will reject '-py3', '-py26', '26' and '3' + tags = '({0})?((-py{2})|(-py{1}(?=[^0-9]))|({2})|({1}(?=[^0-9]))|(?=[^0-9])(?!-py))'.format(tags_pat, kw['python'][0], kw['python']) else: tags = tags_pat # Trying libraries, from most strict match to least one