android support

git-svn-id: svn://db.shs.com.ru/pip@533 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2017-08-07 09:44:57 +00:00
parent b60e146f86
commit ae6d397e0e
4 changed files with 20 additions and 8 deletions

View File

@@ -125,7 +125,7 @@ endif()
# Check if RT timers exists # Check if RT timers exists
set(CMAKE_REQUIRED_INCLUDES time.h) set(CMAKE_REQUIRED_INCLUDES time.h)
set(CMAKE_REQUIRED_LIBRARIES ) set(CMAKE_REQUIRED_LIBRARIES )
if(NOT DEFINED ENV{QNX_HOST} AND NOT APPLE AND NOT WIN32) if((NOT DEFINED ENV{QNX_HOST}) AND (NOT APPLE) AND (NOT WIN32) AND (NOT DEFINED ANDROID_PLATFORM))
list(APPEND LIBS_MAIN rt) list(APPEND LIBS_MAIN rt)
set(CMAKE_REQUIRED_LIBRARIES rt) set(CMAKE_REQUIRED_LIBRARIES rt)
endif() endif()
@@ -211,8 +211,10 @@ else()
if(DEFINED ENV{QNX_HOST}) if(DEFINED ENV{QNX_HOST})
list(APPEND LIBS_MAIN socket) list(APPEND LIBS_MAIN socket)
else() else()
if (NOT DEFINED ANDROID_PLATFORM)
list(APPEND LIBS_MAIN pthread util) list(APPEND LIBS_MAIN pthread util)
endif() endif()
endif()
endif() endif()
foreach(LIB_ ${LIBS_MAIN}) foreach(LIB_ ${LIBS_MAIN})
find_library(${LIB_}_FOUND ${LIB_}) find_library(${LIB_}_FOUND ${LIB_})

View File

@@ -17,10 +17,13 @@ else()
find_library(PIP_CRYPT_LIBRARY pip_crypt ${_DIR_}/lib/) find_library(PIP_CRYPT_LIBRARY pip_crypt ${_DIR_}/lib/)
find_library(PIP_FFTW_LIBRARY pip_fftw ${_DIR_}/lib/) find_library(PIP_FFTW_LIBRARY pip_fftw ${_DIR_}/lib/)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
find_library(PTHREAD_LIBRARY pthread)
find_library(DL_LIBRARY dl) find_library(DL_LIBRARY dl)
list(APPEND PIP_LIBRARY ${DL_LIBRARY})
if (NOT DEFINED ANDROID_PLATFORM)
find_library(PTHREAD_LIBRARY pthread)
find_library(UTIL_LIBRARY util) find_library(UTIL_LIBRARY util)
list(APPEND PIP_LIBRARY ${PTHREAD_LIBRARY} ${DL_LIBRARY} ${UTIL_LIBRARY}) list(APPEND PIP_LIBRARY ${PTHREAD_LIBRARY} ${UTIL_LIBRARY})
endif()
endif() endif()
set(PIP_INCLUDES ${_DIR_}/include/pip) set(PIP_INCLUDES ${_DIR_}/include/pip)
set(PIP_CMG ${_DIR_}/bin/pip_cmg) set(PIP_CMG ${_DIR_}/bin/pip_cmg)

View File

@@ -106,7 +106,7 @@
#endif #endif
#ifdef ANDROID #ifdef ANDROID
# define tcdrain(fd) ioctl(fd, TCSBRK, 1) ///# define tcdrain(fd) ioctl(fd, TCSBRK, 1)
//inline int wctomb(char * c, wchar_t w) {*c = ((char * )&w)[0]; return 1;} //inline int wctomb(char * c, wchar_t w) {*c = ((char * )&w)[0]; return 1;}
//inline int mbtowc(wchar_t * w, const char * c, size_t) {*w = ((wchar_t * )&c)[0]; return 1;} //inline int mbtowc(wchar_t * w, const char * c, size_t) {*w = ((wchar_t * )&c)[0]; return 1;}
#endif #endif
@@ -141,7 +141,9 @@
# ifdef ANDROID # ifdef ANDROID
# pragma GCC diagnostic ignored "-Wunused-parameter" # pragma GCC diagnostic ignored "-Wunused-parameter"
# pragma GCC diagnostic ignored "-Wextra" # pragma GCC diagnostic ignored "-Wextra"
# pragma GCC diagnostic ignored "-Wliteral-suffix" # pragma GCC diagnostic ignored "-Wc++11-extensions"
# pragma GCC diagnostic ignored "-Wundefined-bool-conversion"
//# pragma GCC diagnostic ignored "-Wliteral-suffix"
# endif # endif
#endif #endif

View File

@@ -26,7 +26,12 @@
#include "pitimer.h" #include "pitimer.h"
#include "piiodevice.h" #include "piiodevice.h"
class sockaddr; #ifdef ANDROID
struct
#else
class
#endif
sockaddr;
class PIP_EXPORT PIEthernet: public PIIODevice class PIP_EXPORT PIEthernet: public PIIODevice
{ {