mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #3461
3461: Link with -pthread instead of -lpthread r=def- a=yangfl The canonical way to link with the thread library is to use -pthread, which brings in additional libraries like libatomic.so on riscv64. However cmake defaults to link with -lpthread which only bring the libpthread.so library. Fortunately it has the option THREADS_PREFER_PTHREAD_FLAG for that, which is "highly recommended" but not the default. ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Aurelien Jarno <aurel32@debian.org>
This commit is contained in:
commit
71a371a4ee
|
@ -367,6 +367,10 @@ find_package(Pnglite)
|
|||
find_package(PythonInterp 3)
|
||||
find_package(SDL2)
|
||||
find_package(SQLite3)
|
||||
if(UNIX)
|
||||
# Use -pthread instead of -lpthread to draw dependencies other than libpthread
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
endif()
|
||||
find_package(Threads)
|
||||
find_package(Wavpack)
|
||||
if(WEBSOCKETS)
|
||||
|
|
Loading…
Reference in a new issue