<div dir="ltr">Here's my CMakeLists.txt :<br><br>>>>>>>><br><br><span style="font-family:monospace,monospace">cmake_minimum_required(VERSION 3.8 FATAL_ERROR)<br>project(oscour)<br>set(CMAKE_INCLUDE_CURRENT_DIR ON)<br><br>set(CMAKE_CXX_FLAGS "-fconcepts -fsanitize=address -fsanitize=undefined")<br>set(CMAKE_EXE_LINKER_FLAGS "-fconcepts -fsanitize=address -fsanitize=undefined")<br><br>add_subdirectory(uWebSockets)<br><br>find_package(Threads REQUIRED)<br><br>add_library(oscour INTERFACE)<br>target_sources(oscour INTERFACE<br>  ${CMAKE_CURRENT_SOURCE_DIR}/oscour/oscour.hpp)<br><br>target_include_directories(oscour INTERFACE oscour/)<br>target_link_libraries(oscour INTERFACE uWS Threads::Threads)<br>target_compile_options(oscour INTERFACE -std=c++17)<br><br>add_executable(udp examples/udp.cpp)<br>target_link_libraries(udp PRIVATE oscour)<br><br>add_executable(tcp examples/tcp.cpp)<br>target_link_libraries(tcp PRIVATE oscour)</span><br><br><<<<<<<<<br clear="all"><div><div><div class="gmail_signature"><div dir="ltr"><div><br></div><div>As you can see, I call <br><span style="font-family:monospace,monospace">find_package(Threads REQUIRED)</span></div><div>but at no point my example executables, named udp and tcp, link to -pthread (or -lpthread) (which of course makes my build fails). <br>I also tried to link them explicitely to <span style="font-family:monospace,monospace">Threads::Threads</span>. This did not work either.<br><br></div><div>e.g. when doing make in verbose mode, the link invocation is : <br><br> /usr/bin/g++ -fconcepts -fsanitize=address -fsanitize=undefined -std=c++17 -fconcepts -fsanitize=address -fsanitize=undefined CMakeFiles/complete.dir/examples/udp.cpp.o  -o udp  uWebSockets/libuWS.a /usr/lib/libssl.so /usr/lib/libcrypto.so /usr/lib/libz.so<br></div><br>there is no hint of pthreads in there... what can I do ?<br><br>Best<br><br>Jean-Michaël Celerier<br><a href="http://www.jcelerier.name">http://www.jcelerier.name</a></div></div></div>
</div></div>