util: android logging support
In particular, it would be nice for failed debug_assert() msgs to show up in logcat. Signed-off-by: Rob Clark <robdclark@chromium.org> Kristian H. Kristensen <hoegsberg@chromium.org> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
@@ -134,11 +134,23 @@ format_srgb = custom_target(
|
|||||||
capture : true,
|
capture : true,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
deps_for_libmesa_util = [
|
||||||
|
dep_zlib,
|
||||||
|
dep_clock,
|
||||||
|
dep_thread,
|
||||||
|
dep_atomic,
|
||||||
|
dep_m,
|
||||||
|
]
|
||||||
|
|
||||||
|
if with_platform_android
|
||||||
|
deps_for_libmesa_util += dep_android
|
||||||
|
endif
|
||||||
|
|
||||||
_libmesa_util = static_library(
|
_libmesa_util = static_library(
|
||||||
'mesa_util',
|
'mesa_util',
|
||||||
[files_mesa_util, format_srgb],
|
[files_mesa_util, format_srgb],
|
||||||
include_directories : inc_common,
|
include_directories : inc_common,
|
||||||
dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
|
dependencies : deps_for_libmesa_util,
|
||||||
c_args : [c_msvc_compat_args, c_vis_args],
|
c_args : [c_msvc_compat_args, c_vis_args],
|
||||||
build_by_default : false
|
build_by_default : false
|
||||||
)
|
)
|
||||||
|
@@ -48,7 +48,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || DETECT_OS_HURD
|
#if DETECT_OS_ANDROID
|
||||||
|
# define LOG_TAG "MESA"
|
||||||
|
# include <unistd.h>
|
||||||
|
# include <log/log.h>
|
||||||
|
#elif DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || DETECT_OS_HURD
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#elif DETECT_OS_APPLE || DETECT_OS_BSD
|
#elif DETECT_OS_APPLE || DETECT_OS_BSD
|
||||||
# include <sys/sysctl.h>
|
# include <sys/sysctl.h>
|
||||||
@@ -104,6 +108,9 @@ os_log_message(const char *message)
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fputs(message, fout);
|
fputs(message, fout);
|
||||||
fflush(fout);
|
fflush(fout);
|
||||||
|
# if DETECT_OS_ANDROID
|
||||||
|
LOG_PRI(ANDROID_LOG_ERROR, LOG_TAG, "%s", message);
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user