Skip to content

prepare for linux support #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: foss
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
14 changes: 13 additions & 1 deletion src/log.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
#pragma once

#ifdef __ANDROID__

#include <android/log.h>

#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__)
#define VIPER_LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__)

#else

#include <cstdio>

#define VIPER_LOGD(...) fprintf(stderr, __VA_ARGS__)
#define VIPER_LOGI(...) fprintf(stderr, __VA_ARGS__)
#define VIPER_LOGE(...) fprintf(stderr, __VA_ARGS__)

#endif
Loading