Skip to content

Commit

Permalink
build: Move boost dependency into example
Browse files Browse the repository at this point in the history
This simplifies the build check by using disabler objects, and will
remove the need to do the dependency check if we disable examples. They
will be disabled for subprojects.

Change-Id: I50a4166b98fbb73ae10fa83174c4e6fccdaab740
Signed-off-by: William A. Kennington III <wak@google.com>
  • Loading branch information
wak-google committed Jun 7, 2020
1 parent da0b3f1 commit 7d8dfc4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
32 changes: 19 additions & 13 deletions example/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,25 @@ executable(
dependencies: sdbusplus_dep,
)

if boost_dep.found()
executable(
'asio-example',
'asio-example.cpp',
cpp_args: [
'-DBOOST_ALL_NO_LIB',
'-DBOOST_SYSTEM_NO_DEPRECATED',
'-DBOOST_ERROR_CODE_HEADER_ONLY',
'-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
],
dependencies: [ boost_dep, pthread_dep, sdbusplus_dep ],
)
endif
boost_dep = dependency(
'boost',
disabler: true,
required: false,
modules: [ 'coroutine' ],
)

executable(
'asio-example',
'asio-example.cpp',
cpp_args: [
'-DBOOST_ASIO_DISABLE_THREADS',
'-DBOOST_ALL_NO_LIB',
'-DBOOST_SYSTEM_NO_DEPRECATED',
'-DBOOST_ERROR_CODE_HEADER_ONLY',
'-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
],
dependencies: [ boost_dep, sdbusplus_dep ],
)

calc_buildroot = meson.current_build_dir()
calc_files = files(
Expand Down
5 changes: 0 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ sdbusplus_dep = declare_dependency(

subdir('tools')

boost_dep = dependency(
'boost',
required: false,
modules: [ 'coroutine' ],
)
pthread_dep = dependency('threads')

subdir('example')
Expand Down

0 comments on commit 7d8dfc4

Please sign in to comment.