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: added missing CMake module for asio library #430

Merged
merged 1 commit into from Feb 24, 2023

Conversation

ranisalt
Copy link
Contributor

@ranisalt ranisalt commented Feb 24, 2023

Description

When Boost got removed in favor of standalone Asio, it stopped working on CMake because Asio is not one of the modules usually shipped with CMake (Boost is), thus it failed to configure. Adds a simple script to look for Asio and link as expected.

Behaviour

Actual

CMake Error at src/CMakeLists.txt:179 (find_package):
  By not providing "Findasio.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "asio", but
  CMake did not find one.

  Could not find a package configuration file provided by "asio" with any of
  the following names:

    asioConfig.cmake
    asio-config.cmake

  Add the installation prefix of "asio" to CMAKE_PREFIX_PATH or set
  "asio_DIR" to a directory containing one of the above files.  If "asio"
  provides a separate development package or SDK, be sure it has been
  installed.

Expected

Asio is found and linked against.

Fixes

fix #259
fix #295
but you closed it without fixing

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested

N/A

Test Configuration:

  • Server Version: N/A
  • Client: latest commit
  • Operating System: Arch Linux

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@dudantas dudantas changed the title Add missing CMake module for Asio fix: added missing CMake module for asio library Feb 24, 2023
Copy link
Collaborator

@dudantas dudantas left a comment

Choose a reason for hiding this comment

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

Tested, everything is ok. Remembering that this problem in asio does not occur in windows or ubuntu, apparently only in some other systems, such as arch linux and mac OS, so I limited myself to testing in my development environment only.

@dudantas dudantas merged commit 9ac4ab1 into mehah:main Feb 24, 2023
@ranisalt
Copy link
Contributor Author

ranisalt commented Feb 24, 2023

Tested, everything is ok. Remembering that this problem in asio does not occur in windows or ubuntu, apparently only in some other systems, such as arch linux and mac OS, so I limited myself to testing in my development environment only.

Windows gets sources using different methods, esp. if using vcpkg, but I'll check to see how Ubuntu does it and if they have a better implementation, copy it over.

Edit: sure about that? Just tested Ubuntu jammy and installing asio is not enough, cmake complains about the lack of Findasio.cmake

@ranisalt ranisalt deleted the patch-1 branch February 24, 2023 15:42
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.

Problems with ASIO compilation errors
3 participants