Initial android support (#17)

* Upload Android armv7 libs

* Fix debug build

* utlvector: fix undefined behavior

* wscript: add --use-ccache option

* wscript: store ccache in a separate directory

* Propertly use gl4es

* fontconfig: fix font detection

* [android]remove fontconfig dependency

* Add build guide for other platforms

Co-authored-by: JusicP <slender87844@gmail.com>
Co-authored-by: nillerusr <nillerusr@users.noreply.github.com>
This commit is contained in:
nillerusr
2021-09-02 20:33:03 +03:00
committed by GitHub
co-authored by JusicP nillerusr
parent 2a490d398c
commit 2c6669f5e3
57 changed files with 524 additions and 111 deletions
+18 -2
View File
@@ -247,8 +247,10 @@ HMODULE Sys_LoadLibrary( const char *pLibraryName, Sys_Flags flags )
#elif POSIX
int dlopen_mode = RTLD_NOW;
#ifndef ANDROID
if ( flags & SYS_NOLOAD )
dlopen_mode |= RTLD_NOLOAD;
#endif
HMODULE ret = ( HMODULE )dlopen( str, dlopen_mode );
if ( !ret && !( flags & SYS_NOLOAD ) )
@@ -301,20 +303,34 @@ CSysModule *Sys_LoadModule( const char *pModuleName, Sys_Flags flags /* = SYS_NO
size_t cCwd = strlen( szCwd );
bool bUseLibPrefix = false;
#ifdef ANDROID
struct stat statBuf;
char *dataPath = getenv("APP_DATA_PATH");
Q_snprintf(szAbsoluteModuleName, sizeof(szAbsoluteModuleName), "%s/lib/lib%s", dataPath ,pModuleName);
if( stat(szAbsoluteModuleName, &statBuf) != 0 )
Q_snprintf(szAbsoluteModuleName, sizeof(szAbsoluteModuleName), "%s/lib/%s", dataPath ,pModuleName);
#else
#ifdef POSIX
struct stat statBuf;
Q_snprintf(szModuleName, sizeof(szModuleName), "bin/lib%s", pModuleName);
bUseLibPrefix |= stat(szModuleName, &statBuf) == 0;
#endif
if( bUseLibPrefix )
Q_snprintf( szAbsoluteModuleName, sizeof(szAbsoluteModuleName), "%s/bin/lib%s", szCwd, pModuleName );
else
Q_snprintf( szAbsoluteModuleName, sizeof(szAbsoluteModuleName), "%s/bin/%s", szCwd, pModuleName );
#endif // ANDROID
Msg("LoadLibrary: pModule: %s, path: %s\n", pModuleName, szAbsoluteModuleName);
hDLL = Sys_LoadLibrary( szAbsoluteModuleName, flags );
}
else
Msg("LoadLibrary: path: %s\n", pModuleName);
if ( !hDLL )
{