diff --git a/CMakeLists.txt b/CMakeLists.txt index fb4609f..1c30524 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ add_compile_definitions(VIPER_VERSION=20240314) #add_subdirectory(src/viper/ffts) # ViPERFX -include_directories(src/include) +include_directories(src/include src/viper/effects src/viper/utils) set(FILES # Main @@ -80,6 +80,8 @@ add_library( # Provides a relative path to your source file(s). ${FILES}) +if (ANDROID) target_link_libraries(v4a_re log) # kissfft) +endif() target_compile_options(v4a_re PRIVATE -flto -O3 -DNDEBUG) #target_compile_options(v4afx_r PRIVATE -O2 -DNDEBUG -Wall -Wsign-conversion -Wno-unused-result -Wno-unneeded-internal-declaration -fstrict-aliasing -fvisibility=hidden -Wextra -Wno-unused-parameter) diff --git a/src/log.h b/src/log.h index 294fb50..3f2b68e 100644 --- a/src/log.h +++ b/src/log.h @@ -1,9 +1,21 @@ #pragma once +#ifdef __ANDROID__ + #include #define TAG "ViPER4Android" #define VIPER_LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__) #define VIPER_LOGI(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__) -#define VIPER_LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__) \ No newline at end of file +#define VIPER_LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__) + +#else + +#include + +#define VIPER_LOGD(...) fprintf(stderr, __VA_ARGS__) +#define VIPER_LOGI(...) fprintf(stderr, __VA_ARGS__) +#define VIPER_LOGE(...) fprintf(stderr, __VA_ARGS__) + +#endif