Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix boost asio build #6108

Merged
merged 1 commit into from
Jan 1, 2025
Merged

Fix boost asio build #6108

merged 1 commit into from
Jan 1, 2025

Conversation

yh-sb
Copy link
Contributor

@yh-sb yh-sb commented Jan 1, 2025

asio depends on date_time, but date_time depends on container, exception, regex.

Without this fix, boost asio fails to use in project:

error: In file included from tcp_server/connection.cpp:2:
In file included from tcp_server/connection.hpp:5:
In file included from /Users/yhsb/.xmake/packages/b/boost/1.87.0/ca26f133eba24e8295bc2dae086e8311/include/boost/asio.hpp:33:
In file included from /Users/yhsb/.xmake/packages/b/boost/1.87.0/ca26f133eba24e8295bc2dae086e8311/include/boost/asio/basic_deadline_timer.hpp:27:
In file included from /Users/yhsb/.xmake/packages/b/boost/1.87.0/ca26f133eba24e8295bc2dae086e8311/include/boost/asio/detail/deadline_timer_service.hpp:31:
In file included from /Users/yhsb/.xmake/packages/b/boost/1.87.0/ca26f133eba24e8295bc2dae086e8311/include/boost/asio/detail/timer_queue_ptime.hpp:24:
/Users/yhsb/.xmake/packages/b/boost/1.87.0/ca26f133eba24e8295bc2dae086e8311/include/boost/asio/time_traits.hpp:25:10: fatal error: 'boost/date_time/posix_time/posix_time_types.hpp' file not found
   25 | #include <boost/date_time/posix_time/posix_time_types.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

But, date_time itself depends from the following libraries:

CMake Error at libs/algorithm/CMakeLists.txt:15 (target_link_libraries):
  The link interface of target "boost_algorithm" contains:

    Boost::exception

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

CMake Error at libs/lexical_cast/CMakeLists.txt:15 (target_link_libraries):
  The link interface of target "boost_lexical_cast" contains:

    Boost::container

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

CMake Error at libs/range/CMakeLists.txt:15 (target_link_libraries):
  The link interface of target "boost_range" contains:

    Boost::regex

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

-- Generating done (0.3s)

asio depends on date_time, but date_time depends on container, exception, regex.
@SirLynix SirLynix merged commit aabc10c into xmake-io:dev Jan 1, 2025
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants