IF(PLATFORM STREQUAL "android")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fdiagnostics-color")
ADD_DEFINITIONS(-DANDROID)
+ ADD_DEFINITIONS(-DPLATFORM=${PLATFORM})
INCLUDE(${PROJECT_ROOT_DIR}/cmake/aitt_android_flatbuffers.cmake)
INCLUDE(${PROJECT_ROOT_DIR}/cmake/aitt_android_glib.cmake)
INCLUDE(${PROJECT_ROOT_DIR}/cmake/aitt_android_mosquitto.cmake)
- SET(AITT_NEEDS_LIBRARIES ${GLIB_LIBRARIES} ${MOSQUITTO_LIBRARY} ${FLATBUFFERS_LIBRARY})
+ SET(AITT_NEEDS_LIBRARIES ${GLIB_LIBRARIES} ${MOSQUITTO_LIBRARY} ${FLATBUFFERS_LIBRARY} ${LOG_LIBRARIES})
ELSE(PLATFORM STREQUAL "android")
IF(PLATFORM STREQUAL "tizen")
ADD_DEFINITIONS(-DTIZEN)
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
- arguments '-DLOG_STDOUT=ON'
+ arguments '-DLOG_STDOUT=OFF'
arguments '-DCMAKE_VERBOSE_MAKEFILE=1'
arguments '-DCMAKE_INSTALL_PREFIX:PATH=/usr'
arguments '-DANDROID_STL=c++_shared'
--- /dev/null
+/*
+ * Copyright (c) 2021-2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <android/log.h>
+
+#define PLATFORM_LOGD(fmt, ...) \
+ __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, \
+ "[%s:%s:%d] " fmt, basename((char *)(__FILE__)), __func__, __LINE__, ##__VA_ARGS__)
+
+#define PLATFORM_LOGI(fmt, ...) \
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, \
+ "[%s:%s:%d] " fmt, basename((char *)(__FILE__)), __func__, __LINE__, ##__VA_ARGS__)
+
+#define PLATFORM_LOGE(fmt, ...) \
+ __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, \
+ "[%s:%s:%d] " fmt, basename((char *)(__FILE__)), __func__, __LINE__, ##__VA_ARGS__)