mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Updated cmake for ARM/Android build
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
SET(UTILITE_VERSION "0.3.0")
|
||||
ADD_DEFINITIONS(-DUTILITE_VERSION="${UTILITE_VERSION}")
|
||||
|
||||
IF(UNIX)
|
||||
if(UNIX AND NOT ANDROID)
|
||||
FIND_PACKAGE(Pthreads REQUIRED)
|
||||
ENDIF(UNIX)
|
||||
ENDIF(UNIX AND NOT ANDROID)
|
||||
|
||||
ADD_SUBDIRECTORY( src )
|
||||
ADD_SUBDIRECTORY( resource_generator )
|
||||
@@ -84,9 +84,10 @@ class UThreadC
|
||||
|
||||
static void Exit()
|
||||
{ pthread_exit(0); }
|
||||
|
||||
#ifndef ANDROID
|
||||
static void TestCancel()
|
||||
{ pthread_testcancel(); }
|
||||
#endif
|
||||
|
||||
static Handle Self()
|
||||
{ return (Handle)pthread_self(); }
|
||||
@@ -163,8 +164,10 @@ class UThreadC
|
||||
static int Join( Handle H )
|
||||
{ return pthread_join(H,0); }
|
||||
|
||||
#ifndef ANDROID
|
||||
static int Kill( Handle H )
|
||||
{ return pthread_cancel(H); }
|
||||
#endif
|
||||
|
||||
static int Detach( Handle H )
|
||||
{ return pthread_detach(H); }
|
||||
@@ -180,6 +183,7 @@ class UThreadC
|
||||
Thread_T Data(I.Data);
|
||||
S_Create().release();
|
||||
|
||||
#ifndef ANDROID
|
||||
if ( I.Flags & 1 /*CancelEnable*/ )
|
||||
{
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,NULL);
|
||||
@@ -193,6 +197,7 @@ class UThreadC
|
||||
{
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( I.Owner )
|
||||
I.Owner->ThreadMain(Data);
|
||||
@@ -237,8 +242,10 @@ class UThreadC<void>
|
||||
static void Exit()
|
||||
{ pthread_exit(0); }
|
||||
|
||||
#ifndef ANDROID
|
||||
static void TestCancel()
|
||||
{ pthread_testcancel(); }
|
||||
#endif
|
||||
|
||||
static Handle Self()
|
||||
{ return (Handle)pthread_self(); }
|
||||
@@ -347,8 +354,10 @@ class UThreadC<void>
|
||||
static int Join( Handle H )
|
||||
{ return pthread_join(H,0); }
|
||||
|
||||
#ifndef ANDROID
|
||||
static int Kill( Handle H )
|
||||
{ return pthread_cancel(H); }
|
||||
#endif
|
||||
|
||||
static int Detach( Handle H )
|
||||
{ return pthread_detach(H); }
|
||||
@@ -363,6 +372,7 @@ class UThreadC<void>
|
||||
Instance I(*Param);
|
||||
S_Create().release();
|
||||
|
||||
#ifndef ANDROID
|
||||
if ( I.Flags & 1 /*CancelEnable*/ )
|
||||
{
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,NULL);
|
||||
@@ -376,6 +386,7 @@ class UThreadC<void>
|
||||
{
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( I.Owner )
|
||||
I.Owner->ThreadMain();
|
||||
|
||||
@@ -245,8 +245,10 @@ private:
|
||||
//Methods from UThread<void> class hided
|
||||
static int Join( Handle H )
|
||||
{ return UThreadC<void>::Join(H); }
|
||||
#ifndef ANDROID
|
||||
static int Kill( Handle H )
|
||||
{ return UThreadC<void>::Kill(H); }
|
||||
#endif
|
||||
static int Detach( Handle H )
|
||||
{ return UThreadC<void>::Detach(H); }
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/dir.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
Reference in New Issue
Block a user