This repository has been archived by the owner on Jun 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 279
Standalone Asio not found - but asio.hpp is present #101
Comments
The problem is in pthread linking, it looks like your CMake file (when using
|
pthread linking should be added here: https://github.com/eidheim/Simple-WebSocket-Server/blob/master/CMakeLists.txt#L19 if needed. |
This seems to be a problem with cmake's CheckIncludeFileCXX though. I just confirmed this issue on Antergos. Temporary workaround: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2b0ea16..8f31cb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,11 +22,6 @@ target_link_libraries(simple-websocket-server INTERFACE ${CMAKE_THREAD_LIBS_INIT
# Remove Boost system, thread, regex components; use Boost::<component> aliases; remove Boost target_include_directories
if(USE_STANDALONE_ASIO)
target_compile_definitions(simple-websocket-server INTERFACE USE_STANDALONE_ASIO)
- include(CheckIncludeFileCXX)
- CHECK_INCLUDE_FILE_CXX(asio.hpp HAVE_ASIO)
- if(NOT HAVE_ASIO)
- message(FATAL_ERROR "Standalone Asio not found")
- endif()
else()
find_package(Boost 1.54.0 COMPONENTS system thread coroutine context REQUIRED)
target_link_libraries(simple-websocket-server INTERFACE ${Boost_LIBRARIES}) |
Yeah, I ended up with the same workaround (although it should be temporary for sure since we're not checking if asio.hpp is present hence the compilation can start and fail if the library is not present for real). |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, thank you for this library!
I'm trying to use the library with ASIO but, although it's installed in my system, cmake fails.
My environment:
OS: Archlinux
compiler: clang
cmake version: 3.10.3
Steps to reproduce:
Error: Standalone Asio not found
But
ls /usr/include/asio*
returns:Hence asio.hpp is present and the whole asio library too.
How can I fix this? (My guess is that the problem is related to cmake somehow)
Thank you
The text was updated successfully, but these errors were encountered: