@@ -14,11 +14,9 @@ project(RunAnywhereCommons
1414# OPTIONS
1515# =============================================================================
1616
17- # Backend build options
18- option (RAC_BUILD_LLAMACPP "Build LlamaCpp backend module" ON )
19- option (RAC_BUILD_ONNX "Build ONNX backend module (STT, TTS, VAD)" ON )
20- option (RAC_BUILD_WHISPERCPP "Build WhisperCpp backend module (STT)" OFF )
21- option (RAC_BUILD_PLATFORM "Build Platform backend module (Apple Foundation Models, System TTS)" ON )
17+ # NOTE: LlamaCpp, ONNX, and WhisperCpp backends have been moved to runanywhere-core.
18+ # The SDKs consume RAC APIs directly from runanywhere-core's build artifacts.
19+ # Platform services (Apple Foundation Models, System TTS) are built into rac_commons.
2220option (RAC_BUILD_JNI "Build JNI bridge for Android/JVM" OFF )
2321
2422# Feature options
@@ -128,9 +126,6 @@ else()
128126 # This matches iOS where we combine static .a files into xcframeworks
129127 set (RA_BUILD_MODULAR ON CACHE BOOL "" FORCE )
130128 set (RA_BUILD_SHARED OFF CACHE BOOL "" FORCE ) # Force static libs for static linking
131- set (RA_BUILD_LLAMACPP ${RAC_BUILD_LLAMACPP} CACHE BOOL "" FORCE )
132- set (RA_BUILD_ONNX ${RAC_BUILD_ONNX} CACHE BOOL "" FORCE )
133- set (RA_BUILD_WHISPERCPP ${RAC_BUILD_WHISPERCPP} CACHE BOOL "" FORCE )
134129
135130 add_subdirectory (${RUNANYWHERE_CORE_DIR} ${CMAKE_BINARY_DIR} /runanywhere-core )
136131endif ()
@@ -210,13 +205,13 @@ set(RAC_FEATURES_SOURCES
210205 src/features/result_free.cpp
211206)
212207
213- # Platform backend sources (Apple Foundation Models + System TTS)
208+ # Platform services (Apple Foundation Models + System TTS)
214209# These are always included on Apple platforms since they're required for platform services
215210if (APPLE )
216211 set (RAC_PLATFORM_SOURCES
217- backends/platform/src /rac_llm_platform.cpp
218- backends/platform/src /rac_tts_platform.cpp
219- backends/platform/src /rac_backend_platform_register.cpp
212+ src/features/platform /rac_llm_platform.cpp
213+ src/features/platform /rac_tts_platform.cpp
214+ src/features/platform /rac_backend_platform_register.cpp
220215 )
221216else ()
222217 set (RAC_PLATFORM_SOURCES "" )
@@ -270,23 +265,8 @@ elseif(NOT USE_PREBUILT_CORE AND DEFINED RUNANYWHERE_CORE_INCLUDE_DIRS)
270265endif ()
271266
272267# Backend headers - needed for vtable dispatch in service files
273- # These headers define backend-specific functions called through vtables
274- if (RAC_BUILD_LLAMACPP)
275- target_include_directories (rac_commons PUBLIC
276- $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /backends /llamacpp /include >
277- )
278- endif ()
279- if (RAC_BUILD_ONNX)
280- target_include_directories (rac_commons PUBLIC
281- $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /backends /onnx /include >
282- )
283- endif ()
284- # Platform backend headers (always on Apple)
285- if (APPLE )
286- target_include_directories (rac_commons PUBLIC
287- $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /backends /platform /include >
288- )
289- endif ()
268+ # NOTE: LlamaCpp, ONNX, and WhisperCpp backend headers are now in runanywhere-core.
269+ # Platform headers are now in include/rac/features/platform/ (included via main include dir)
290270
291271# Link against runanywhere-core bridge
292272# Note: In source compilation mode, we do NOT link rac_commons against runanywhere_bridge directly.
@@ -313,49 +293,6 @@ if(RAC_BUILD_SHARED)
313293 )
314294endif ()
315295
316- # =============================================================================
317- # BACKEND MODULES
318- # =============================================================================
319- #
320- # Backend libraries provide specific ML inference implementations:
321- # - llamacpp: LLM text generation (GGUF models via llama.cpp)
322- # - onnx: STT, TTS, VAD (ONNX Runtime models)
323- # - whispercpp: STT (Whisper.cpp models)
324- #
325- # Each backend:
326- # 1. Links against rac_commons for service registration
327- # 2. Links against runanywhere-core for low-level inference
328- # 3. Builds into a static library (.a) or xcframework
329- #
330-
331- if (RAC_BUILD_LLAMACPP)
332- if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /backends/llamacpp/CMakeLists.txt" )
333- message (STATUS "Building LlamaCpp backend" )
334- add_subdirectory (backends/llamacpp )
335- endif ()
336- endif ()
337-
338- if (RAC_BUILD_ONNX)
339- if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /backends/onnx/CMakeLists.txt" )
340- message (STATUS "Building ONNX backend" )
341- add_subdirectory (backends/onnx )
342- endif ()
343- endif ()
344-
345- if (RAC_BUILD_WHISPERCPP)
346- if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /backends/whispercpp/CMakeLists.txt" )
347- message (STATUS "Building WhisperCpp backend" )
348- add_subdirectory (backends/whispercpp )
349- endif ()
350- endif ()
351-
352- if (RAC_BUILD_PLATFORM)
353- if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /backends/platform/CMakeLists.txt" )
354- message (STATUS "Building Platform backend (Apple Foundation Models, System TTS)" )
355- add_subdirectory (backends/platform )
356- endif ()
357- endif ()
358-
359296# =============================================================================
360297# JNI BRIDGE (Android/JVM)
361298# =============================================================================
@@ -403,11 +340,10 @@ message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
403340message (STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} " )
404341message (STATUS "Shared libs: ${RAC_BUILD_SHARED} " )
405342message (STATUS "" )
406- message (STATUS "Backend modules:" )
407- message (STATUS " LlamaCpp: ${RAC_BUILD_LLAMACPP} " )
408- message (STATUS " ONNX: ${RAC_BUILD_ONNX} " )
409- message (STATUS " WhisperCpp: ${RAC_BUILD_WHISPERCPP} " )
410- message (STATUS " Platform: ${RAC_BUILD_PLATFORM} " )
343+ if (APPLE )
344+ message (STATUS "Platform services: Apple Foundation Models, System TTS (built into rac_commons)" )
345+ endif ()
346+ message (STATUS "NOTE: LlamaCpp, ONNX, WhisperCpp backends moved to runanywhere-core" )
411347message (STATUS "" )
412348message (STATUS "JNI bridge: ${RAC_BUILD_JNI} " )
413349message (STATUS "====================================" )
0 commit comments