BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.72k stars 267 forks source link

build for android failed due to error: unable to find library -lpthread #273

Open leleliu008 opened 2 years ago

leleliu008 commented 2 years ago

I suggest CMakeLists.txt#L141

target_link_libraries(basisu m pthread)

change to following:

target_link_libraries(basisu m)

if (UNIX)
    find_library(LIBPTHREAD pthread)
    if (LIBPTHREAD)                      
        target_link_libraries(basisu pthread)
    endif()
endif()

Android has no separated libpthread, it is included in libc

Reference: https://developer.android.com/ndk/guides/stable_apis#c_library https://cmake.org/cmake/help/latest/variable/UNIX.html