-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaap-juce-support.patch
172 lines (167 loc) · 4.96 KB
/
aap-juce-support.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
diff --git a/libs/LuaJitLib/CMakeLists.txt b/libs/LuaJitLib/CMakeLists.txt
index 54182fcd..cfb8105f 100644
--- a/libs/LuaJitLib/CMakeLists.txt
+++ b/libs/LuaJitLib/CMakeLists.txt
@@ -310,8 +310,8 @@ else()
IF(MINILUA_USE_LIBM)
set(MINILUA_LIBS m)
ENDIF()
- if(LINUX_ON_ARM)
- message(STATUS "Forcing minilua libm on LINUX_ON_ARM")
+ if(LINUX_ON_ARM OR NOT ("${ANDROID_ABI}" STREQUAL ""))
+ message(STATUS "Forcing minilua libm on LINUX_ON_ARM / ANDROID")
list(APPEND MINILUA_LIBS m)
endif()
Submodule libs/sst/sst-plugininfra contains modified content
diff --git a/libs/sst/sst-plugininfra/src/paths_linux.cpp b/libs/sst/sst-plugininfra/src/paths_linux.cpp
index 1f24bdc..b4b1edd 100644
--- a/libs/sst/sst-plugininfra/src/paths_linux.cpp
+++ b/libs/sst/sst-plugininfra/src/paths_linux.cpp
@@ -20,10 +20,14 @@ namespace paths
{
fs::path homePath()
{
+#if ANDROID
+ return fs::path{"/data/data/org.androidaudioplugin.ports.juce.surge_xt"};
+#else
const char *const path = std::getenv("HOME");
if (!path || !path[0])
throw std::runtime_error{"The environment variable HOME is unset or empty"};
return fs::path{path};
+#endif
}
fs::path sharedLibraryBinaryPath()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 173ca278..85572038 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -163,3 +163,10 @@ endif()
if(NOT CMAKE_CROSSCOMPILING AND NOT SURGE_SKIP_JUCE_FOR_RACK)
include(cmake/pluginval.cmake)
endif()
+
+# begin AAP specifics -->
+
+message("AAP_DIR: ${AAP_DIR}")
+message("AAP_JUCE_DIR: ${AAP_JUCE_DIR}")
+juce_add_modules(${AAP_JUCE_DIR}/aap-modules/aap_audio_processors)
+# <-- end AAP specifics
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 568287ff..5b9706ef 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -315,10 +315,12 @@ elseif(UNIX)
pthread
)
else()
+ if(NOT ANDROID)
target_link_libraries(${PROJECT_NAME} PRIVATE
pthread
-Wl,--no-undefined
)
+ endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "BSD")
target_link_libraries(${PROJECT_NAME} PRIVATE execinfo)
diff --git a/src/common/DebugHelpers.cpp b/src/common/DebugHelpers.cpp
index a48dfa89..ee5bb0ba 100644
--- a/src/common/DebugHelpers.cpp
+++ b/src/common/DebugHelpers.cpp
@@ -64,7 +64,7 @@ bool Surge::Debug::toggleConsole()
void Surge::Debug::stackTraceToStdout(int depth)
{
-#if MAC || LINUX
+#if MAC || LINUX && !ANDROID
void *callstack[128];
int i, frames = backtrace(callstack, 128);
char **strs = backtrace_symbols(callstack, frames);
diff --git a/src/surge-fx/CMakeLists.txt b/src/surge-fx/CMakeLists.txt
index 611194a2..3caf143a 100644
--- a/src/surge-fx/CMakeLists.txt
+++ b/src/surge-fx/CMakeLists.txt
@@ -69,3 +69,41 @@ if(SURGE_BUILD_CLAP)
endif()
surge_juce_package(${PROJECT_NAME} "Surge XT Effects")
+
+# begin AAP specifics -->
+
+# They are needed in desktop too, for generate-aap-metadata.
+include_directories(
+ "${AAP_DIR}/include"
+ "${AAP_JUCE_DIR}/modules"
+)
+
+add_definitions([[-DJUCE_PUSH_NOTIFICATIONS_ACTIVITY="com/rmsl/juce/JuceActivity"]])
+
+target_compile_definitions(${PROJECT_NAME} PUBLIC
+ JUCE_PUSH_NOTIFICATIONS=1
+ )
+
+if (ANDROID)
+
+ # dependencies
+ find_library(log "log")
+ find_library(android "android")
+ find_library(glesv2 "GLESv2")
+ find_library(egl "EGL")
+ set(cpufeatures_lib "cpufeatures")
+ set(oboe_lib "oboe")
+
+ target_include_directories(${PROJECT_NAME} PRIVATE
+ "${ANDROID_NDK}/sources/android/cpufeatures"
+ "${OBOE_DIR}/include"
+ )
+
+endif (ANDROID)
+
+target_link_libraries(${PROJECT_NAME}
+ PRIVATE
+ aap_audio_processors
+ )
+# <-- end Android specifics
+# <-- end AAP specifics
diff --git a/src/surge-xt/CMakeLists.txt b/src/surge-xt/CMakeLists.txt
index 906361c5..4dc39d1c 100644
--- a/src/surge-xt/CMakeLists.txt
+++ b/src/surge-xt/CMakeLists.txt
@@ -213,3 +213,41 @@ target_include_directories(${PROJECT_NAME}
)
surge_juce_package(${PROJECT_NAME} "Surge XT")
+
+# begin AAP specifics -->
+
+# They are needed in desktop too, for generate-aap-metadata.
+include_directories(
+ "${AAP_DIR}/include"
+ "${AAP_JUCE_DIR}/modules"
+)
+
+add_definitions([[-DJUCE_PUSH_NOTIFICATIONS_ACTIVITY="com/rmsl/juce/JuceActivity"]])
+
+target_compile_definitions(${PROJECT_NAME} PUBLIC
+ JUCE_PUSH_NOTIFICATIONS=1
+ )
+
+if (ANDROID)
+
+ # dependencies
+ find_library(log "log")
+ find_library(android "android")
+ find_library(glesv2 "GLESv2")
+ find_library(egl "EGL")
+ set(cpufeatures_lib "cpufeatures")
+ set(oboe_lib "oboe")
+
+ target_include_directories(${PROJECT_NAME} PRIVATE
+ "${ANDROID_NDK}/sources/android/cpufeatures"
+ "${OBOE_DIR}/include"
+ )
+
+endif (ANDROID)
+
+target_link_libraries(${PROJECT_NAME}
+ PRIVATE
+ aap_audio_processors
+ )
+# <-- end Android specifics
+# <-- end AAP specifics