Skip to content

Commit

Permalink
Refine include headers
Browse files Browse the repository at this point in the history
sdbusplus #includes all of asio.hpp, which causes every single consumer
compile all of asio, just to throw it away afterward.  This is wasteful.

This commit changes sdbusplus to only include the components that it
uses, and (hopefully) decrease the overall project compile times by a
bit.

This commit requires:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-net-ipmid/+/35718
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/35719
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-objmgr/+/35720

Before the project as a whole will build.

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Id6372de936cd2562ff3c96f19f632ccfaa21c14e
  • Loading branch information
edtanous authored and williamspatrick committed Aug 25, 2020
1 parent 1147250 commit 38ab5ec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion include/sdbusplus/asio/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
#define BOOST_COROUTINES_NO_DEPRECATION_WARNING
#endif

#include <boost/asio.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/posix/stream_descriptor.hpp>
#include <boost/asio/post.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/callable_traits.hpp>
#include <sdbusplus/asio/detail/async_send_handler.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/sdbusplus/asio/detail/async_send_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <systemd/sd-bus.h>

#include <boost/asio.hpp>
#include <boost/system/error_code.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/message.hpp>

Expand Down
4 changes: 3 additions & 1 deletion include/sdbusplus/asio/sd_event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

#include <systemd/sd-event.h>

#include <boost/asio.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/posix/stream_descriptor.hpp>
#include <boost/system/error_code.hpp>

namespace sdbusplus
{
Expand Down
1 change: 1 addition & 0 deletions test/bus/aio.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <boost/asio/io_service.hpp>
#include <sdbusplus/asio/object_server.hpp>
#include <sdbusplus/bus.hpp>

Expand Down

0 comments on commit 38ab5ec

Please sign in to comment.