Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions mesonbuild/dependencies/boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,6 @@ def run_check(self, inc_dirs: T.List[BoostIncludeDir], lib_dirs: T.List[Path]) -
mlog.debug(' - potential library dirs: {}'.format([x.as_posix() for x in lib_dirs]))
mlog.debug(' - potential include dirs: {}'.format([x.path.as_posix() for x in inc_dirs]))

must_have_library = ['boost_python']

# 2. Find all boost libraries
libs: T.List[BoostLibraryFile] = []
for i in lib_dirs:
Expand All @@ -453,10 +451,6 @@ def run_check(self, inc_dirs: T.List[BoostIncludeDir], lib_dirs: T.List[Path]) -
break
libs = sorted(set(libs))

any_libs_found = len(libs) > 0
if not any_libs_found:
return False

modules = ['boost_' + x for x in self.modules]
for inc in inc_dirs:
mlog.debug(f' - found boost {inc.version} include dir: {inc.path}')
Expand All @@ -467,7 +461,7 @@ def run_check(self, inc_dirs: T.List[BoostIncludeDir], lib_dirs: T.List[Path]) -
mlog.debug(f' - {j}')

# 3. Select the libraries matching the requested modules
not_found_as_libs: T.List[str] = []
not_found: T.List[str] = []
selected_modules: T.List[BoostLibraryFile] = []
for mod in modules:
found = False
Expand All @@ -477,24 +471,7 @@ def run_check(self, inc_dirs: T.List[BoostIncludeDir], lib_dirs: T.List[Path]) -
found = True
break
if not found:
not_found_as_libs += [mod]

# If a lib is not found, but an include directory exists,
# assume it is a header only module.
not_found: T.List[str] = []
for boost_modulename in not_found_as_libs:
assert boost_modulename.startswith('boost_')
if boost_modulename in must_have_library:
not_found.append(boost_modulename)
continue
include_subdir = boost_modulename.replace('boost_', 'boost/', 1)
headerdir_found = False
for inc_dir in inc_dirs:
if (inc_dir.path / include_subdir).is_dir():
headerdir_found = True
break
if not headerdir_found:
not_found.append(boost_modulename)
not_found += [mod]

# log the result
mlog.debug(' - found:')
Expand Down
2 changes: 1 addition & 1 deletion test cases/failing/63 wrong boost module/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ if not dependency('boost', required: false).found()
endif

# abc doesn't exist
linkdep = dependency('boost', modules : ['thread', 'system', 'test', 'abc'])
linkdep = dependency('boost', modules : ['thread', 'test', 'abc'])
4 changes: 2 additions & 2 deletions test cases/frameworks/1 boost/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ endif
# within one project. The need to be independent of each other.
# Use one without a library dependency and one with it.

linkdep = dependency('boost', static: s, modules : ['thread', 'system', 'date_time'])
linkdep = dependency('boost', static: s, modules : ['thread', 'date_time'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message should probably say "tests: ..." if it is test-only.

But this change shouldn't be made at all, I think. We want to test that the (eventual) new handling correctly handles cases where existing meson.build files still specify Boost.system. Otherwise we won't be exercising the proposed new codepaths.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, and Bionic has saved us by explicitly failing. Its boost is old enough that libboost_system.so isn't a stub at all, it has genuine required symbols and the testcase fails to compile due to not asking for system.

testdep = dependency('boost', static: s, modules : ['unit_test_framework'])
nomoddep = dependency('boost', static: s)
extralibdep = dependency('boost', static: s, modules : ['thread', 'system', 'date_time', 'log_setup', 'log', 'filesystem', 'regex'])
extralibdep = dependency('boost', static: s, modules : ['thread', 'date_time', 'log_setup', 'log', 'filesystem', 'regex'])
notfound = dependency('boost', static: s, modules : ['this_should_not_exist_on_any_system'], required: false)

assert(not notfound.found())
Expand Down
Loading