diff options
author | Soumith Chintala <soumith@gmail.com> | 2016-02-01 03:14:40 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2016-02-01 03:14:40 +0300 |
commit | 311571f1b7b04eebec152723a282870e23cee237 (patch) | |
tree | 30c13877dc163f76a4a63aeaafe18907c51ad4e1 | |
parent | d37e0e196e2d930f61819ac54538990f6ebfcd58 (diff) | |
parent | a8611d070bf5de53cc432fb50a1a3c68b9b729bb (diff) |
Merge pull request #46 from torch/androidfix
minor fixes for android
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | lib/threads.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a583a6f..8ae8615 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,3 +41,7 @@ else() message(FATAL_ERROR "no threading system (pthread or Win32) available") endif() endif() + +IF(LUALIB) + TARGET_LINK_LIBRARIES(threadsmain ${LUALIB}) +ENDIF() diff --git a/lib/threads.c b/lib/threads.c index fbb8d60..6d845c4 100644 --- a/lib/threads.c +++ b/lib/threads.c @@ -20,7 +20,11 @@ static int thread_new(lua_State *L) luaL_error(L, "threads: out of memory"); memcpy(code_dup, code, len+1); +#ifdef RTLD_NODELETE /* platforms like android dont seem to support this */ void* lib = dlopen("libthreadsmain.so", RTLD_LAZY|RTLD_LOCAL|RTLD_NODELETE); +#else + void* lib = dlopen("libthreadsmain.so", RTLD_LAZY|RTLD_LOCAL); +#endif if (!lib) { free(code_dup); luaL_error(L, "threads: dlopen: %s", dlerror()); |