Commit 7771212
authored
CMakeLists.txt: Fix Android pthread linkage (bytecodealliance#3591)
https://developer.android.com/ndk/guides/stable_apis#core_cc
> Note that on Android, unlike Linux, there are no separate libpthread or librt libraries.
That functionality is included directly in libc, which does not need to be explicitly linked against.
Set `THREADS_PREFER_PTHREAD_FLAG` ON and find package `Threads`, then link
`${CMAKE_THREAD_LIBS_INIT}` instead of `-lpthread`.
ps.
https://cmake.org/cmake/help/latest/module/FindThreads.html1 parent 1f94cd4 commit 7771212
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
150 | | - | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
163 | | - | |
| 166 | + | |
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
| |||
0 commit comments