@@ -11,10 +11,11 @@ setlocal enabledelayedexpansion
1111::
1212:: OPTIONS:
1313:: --skip-backends Build RACommons only; do not build backend frameworks
14- :: --backend NAME Build specific backend: llamacpp, onnx, all (default: all)
14+ :: --backend NAME Build specific backend: llamacpp, onnx, rag, all (default: all)
1515:: - llamacpp: LLM text generation (GGUF models)
1616:: - onnx: STT/TTS/VAD (ONNX Runtime + Sherpa-ONNX)
17- :: - all: Both backends (default)
17+ :: - rag: RAG backend (embeddings + text generation)
18+ :: - all: All backends (default)
1819:: --clean Remove build and dist directories before building
1920:: --release Release build (default)
2021:: --debug Debug build
@@ -27,7 +28,7 @@ setlocal enabledelayedexpansion
2728:: --help, -h Show this help
2829::
2930:: OUTPUTS:
30- :: dist\windows\bin\ RACommons and backend DLLs (if shared)
31+ :: dist\windows\bin\ RACommons and backend DLLs (if shared): rac_commons, rac_backend_llamacpp, rac_backend_onnx, rac_backend_rag
3132:: dist\windows\lib\ Import libraries (.lib) and static libs
3233:: dist\windows\include\ Public headers
3334::
@@ -38,6 +39,9 @@ setlocal enabledelayedexpansion
3839:: REM Build only LlamaCPP backend (no ONNX dependencies)
3940:: scripts\build-windows.bat --backend llamacpp
4041::
42+ :: REM Build only RAG backend (embeddings + text generation, needs ONNX)
43+ :: scripts\build-windows.bat --backend rag
44+ ::
4145:: REM Build only RACommons (no backends)
4246:: scripts\build-windows.bat --skip-backends
4347::
@@ -114,7 +118,7 @@ echo USAGE: scripts\build-windows.bat [options]
114118echo .
115119echo OPTIONS:
116120echo --skip-backends Build RACommons only
117- echo --backend NAME all ^ | llamacpp ^ | onnx (default: all)
121+ echo --backend NAME all ^ | llamacpp ^ | onnx ^ | rag (default: all)
118122echo --clean Clean build and dist first
119123echo --release Release build (default)
120124echo --debug Debug build
@@ -129,6 +133,7 @@ echo.
129133echo EXAMPLES:
130134echo scripts\build-windows.bat # Full build (needs third_party deps)
131135echo scripts\build-windows.bat --backend llamacpp # LlamaCPP only
136+ echo scripts\build-windows.bat --backend rag # RAG only (uses ONNX + LlamaCPP)
132137echo scripts\build-windows.bat --clean --package # Clean build + ZIP
133138echo .
134139exit /b 0
@@ -140,10 +145,11 @@ set "BACKEND_VALID=0"
140145if /i " !BUILD_BACKEND! " == " all" set " BACKEND_VALID = 1"
141146if /i " !BUILD_BACKEND! " == " llamacpp" set " BACKEND_VALID = 1"
142147if /i " !BUILD_BACKEND! " == " onnx" set " BACKEND_VALID = 1"
148+ if /i " !BUILD_BACKEND! " == " rag" set " BACKEND_VALID = 1"
143149
144150if " !BACKEND_VALID! " == " 0" (
145151 echo [ERROR] Invalid --backend: !BUILD_BACKEND!
146- echo [ERROR] Valid backend options are: all, llamacpp, onnx
152+ echo [ERROR] Valid backend options are: all, llamacpp, onnx, rag
147153 exit /b 1
148154)
149155
@@ -223,20 +229,29 @@ if errorlevel 1 (
223229set " RAC_BUILD_BACKENDS = ON"
224230set " RAC_BACKEND_LLAMACPP = ON"
225231set " RAC_BACKEND_ONNX = ON"
232+ set " RAC_BACKEND_RAG = ON"
226233set " RAC_BACKEND_WHISPERCPP = OFF"
227234
228235if " %SKIP_BACKENDS% " == " 1" (
229236 set " RAC_BUILD_BACKENDS = OFF"
230237 set " RAC_BACKEND_LLAMACPP = OFF"
231238 set " RAC_BACKEND_ONNX = OFF"
239+ set " RAC_BACKEND_RAG = OFF"
232240) else (
233241 if /i " %BUILD_BACKEND% " == " llamacpp" (
234242 set " RAC_BACKEND_LLAMACPP = ON"
235243 set " RAC_BACKEND_ONNX = OFF"
244+ set " RAC_BACKEND_RAG = OFF"
236245 )
237246 if /i " %BUILD_BACKEND% " == " onnx" (
238247 set " RAC_BACKEND_LLAMACPP = OFF"
239248 set " RAC_BACKEND_ONNX = ON"
249+ set " RAC_BACKEND_RAG = OFF"
250+ )
251+ if /i " %BUILD_BACKEND% " == " rag" (
252+ set " RAC_BACKEND_LLAMACPP = ON"
253+ set " RAC_BACKEND_ONNX = ON"
254+ set " RAC_BACKEND_RAG = ON"
240255 )
241256)
242257
@@ -258,6 +273,7 @@ set "CMAKE_ARGS=%CMAKE_ARGS% -DRAC_BUILD_TESTS=OFF"
258273set " CMAKE_ARGS = %CMAKE_ARGS% -DRAC_BUILD_BACKENDS=%RAC_BUILD_BACKENDS% "
259274set " CMAKE_ARGS = %CMAKE_ARGS% -DRAC_BACKEND_LLAMACPP=%RAC_BACKEND_LLAMACPP% "
260275set " CMAKE_ARGS = %CMAKE_ARGS% -DRAC_BACKEND_ONNX=%RAC_BACKEND_ONNX% "
276+ set " CMAKE_ARGS = %CMAKE_ARGS% -DRAC_BACKEND_RAG=%RAC_BACKEND_RAG% "
261277set " CMAKE_ARGS = %CMAKE_ARGS% -DRAC_BACKEND_WHISPERCPP=%RAC_BACKEND_WHISPERCPP% "
262278set " CMAKE_ARGS = %CMAKE_ARGS% -DRAC_BUILD_SHARED=%RAC_SHARED_FLAG% "
263279
@@ -313,22 +329,28 @@ if "%BUILD_OUT%"=="" set "BUILD_OUT=%BUILD_DIR%"
313329if exist " %BUILD_OUT% \rac_commons.dll" copy /y " %BUILD_OUT% \rac_commons.dll" " %DIST_BIN% \" > nul
314330if exist " %BUILD_OUT% \rac_backend_llamacpp.dll" copy /y " %BUILD_OUT% \rac_backend_llamacpp.dll" " %DIST_BIN% \" > nul
315331if exist " %BUILD_OUT% \rac_backend_onnx.dll" copy /y " %BUILD_OUT% \rac_backend_onnx.dll" " %DIST_BIN% \" > nul
332+ if exist " %BUILD_OUT% \rac_backend_rag.dll" copy /y " %BUILD_OUT% \rac_backend_rag.dll" " %DIST_BIN% \" > nul
316333if exist " %BUILD_OUT% \src\backends\llamacpp\rac_backend_llamacpp.dll" copy /y " %BUILD_OUT% \src\backends\llamacpp\rac_backend_llamacpp.dll" " %DIST_BIN% \" > nul
317334if exist " %BUILD_OUT% \src\backends\onnx\rac_backend_onnx.dll" copy /y " %BUILD_OUT% \src\backends\onnx\rac_backend_onnx.dll" " %DIST_BIN% \" > nul
335+ if exist " %BUILD_OUT% \src\backends\rag\rac_backend_rag.dll" copy /y " %BUILD_OUT% \src\backends\rag\rac_backend_rag.dll" " %DIST_BIN% \" > nul
318336
319337:: Copy import libs / static libs to lib
320338if exist " %BUILD_OUT% \rac_commons.lib" copy /y " %BUILD_OUT% \rac_commons.lib" " %DIST_LIB% \" > nul
321339if exist " %BUILD_OUT% \rac_backend_llamacpp.lib" copy /y " %BUILD_OUT% \rac_backend_llamacpp.lib" " %DIST_LIB% \" > nul
322340if exist " %BUILD_OUT% \rac_backend_onnx.lib" copy /y " %BUILD_OUT% \rac_backend_onnx.lib" " %DIST_LIB% \" > nul
341+ if exist " %BUILD_OUT% \rac_backend_rag.lib" copy /y " %BUILD_OUT% \rac_backend_rag.lib" " %DIST_LIB% \" > nul
323342if exist " %BUILD_OUT% \src\backends\llamacpp\rac_backend_llamacpp.lib" copy /y " %BUILD_OUT% \src\backends\llamacpp\rac_backend_llamacpp.lib" " %DIST_LIB% \" > nul
324343if exist " %BUILD_OUT% \src\backends\onnx\rac_backend_onnx.lib" copy /y " %BUILD_OUT% \src\backends\onnx\rac_backend_onnx.lib" " %DIST_LIB% \" > nul
344+ if exist " %BUILD_OUT% \src\backends\rag\rac_backend_rag.lib" copy /y " %BUILD_OUT% \src\backends\rag\rac_backend_rag.lib" " %DIST_LIB% \" > nul
325345
326346:: PDB files (optional, for debugging)
327347if exist " %BUILD_OUT% \rac_commons.pdb" copy /y " %BUILD_OUT% \rac_commons.pdb" " %DIST_BIN% \" > nul
328348if exist " %BUILD_OUT% \rac_backend_llamacpp.pdb" copy /y " %BUILD_OUT% \rac_backend_llamacpp.pdb" " %DIST_BIN% \" > nul
329349if exist " %BUILD_OUT% \rac_backend_onnx.pdb" copy /y " %BUILD_OUT% \rac_backend_onnx.pdb" " %DIST_BIN% \" > nul
350+ if exist " %BUILD_OUT% \rac_backend_rag.pdb" copy /y " %BUILD_OUT% \rac_backend_rag.pdb" " %DIST_BIN% \" > nul
330351if exist " %BUILD_OUT% \src\backends\llamacpp\rac_backend_llamacpp.pdb" copy /y " %BUILD_OUT% \src\backends\llamacpp\rac_backend_llamacpp.pdb" " %DIST_BIN% \" > nul
331352if exist " %BUILD_OUT% \src\backends\onnx\rac_backend_onnx.pdb" copy /y " %BUILD_OUT% \src\backends\onnx\rac_backend_onnx.pdb" " %DIST_BIN% \" > nul
353+ if exist " %BUILD_OUT% \src\backends\rag\rac_backend_rag.pdb" copy /y " %BUILD_OUT% \src\backends\rag\rac_backend_rag.pdb" " %DIST_BIN% \" > nul
332354
333355:: Headers: rac and backends
334356if exist " %PROJECT_ROOT% \include\rac" (
0 commit comments