-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild-ci.bat
More file actions
49 lines (40 loc) · 1.22 KB
/
build-ci.bat
File metadata and controls
49 lines (40 loc) · 1.22 KB
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
@echo off
REM Try to find cmake - prefer hardcoded path, fall back to PATH
set CMAKE_EXE="C:\Program Files\CMake\bin\cmake.exe"
if not exist %CMAKE_EXE% (
echo CMake not found at hardcoded path, trying PATH...
set CMAKE_EXE=cmake
)
REM Determine vcpkg toolchain path
if defined VCPKG_ROOT (
set "VCPKG_TOOLCHAIN=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake"
) else (
set "VCPKG_TOOLCHAIN=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
)
set "NEED_CONFIG="
if not exist "build\\CMakeCache.txt" set "NEED_CONFIG=1"
if not exist "build\\AudioCapture.sln" set "NEED_CONFIG=1"
if defined NEED_CONFIG (
if not exist "build" mkdir build
cd build
%CMAKE_EXE% .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=%VCPKG_TOOLCHAIN% -DVCPKG_TARGET_TRIPLET=x64-windows-static
if errorlevel 1 (
echo ERROR: CMake configuration failed
cd ..
exit /b 1
)
cd ..
)
%CMAKE_EXE% --build build --config Release --target AudioCapture
if errorlevel 1 (
echo ERROR: Build failed
exit /b 1
)
if not exist "package" mkdir package
copy /Y "build\bin\Release\AudioCapture.exe" "package\AudioCapture.exe" >nul
if errorlevel 1 (
echo ERROR: Failed to copy executable
exit /b 1
)
echo Libraries are statically linked - no DLLs needed.
exit /b 0