forked from microsoft/mssql-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeep_single_arch.bat
More file actions
38 lines (31 loc) · 1.42 KB
/
keep_single_arch.bat
File metadata and controls
38 lines (31 loc) · 1.42 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
@echo off
REM keep_single_arch.bat - Preserves only the target architecture odbc libs and removes others - for packaging
REM This script is intended to be run after the build process to clean up unnecessary architecture libraries.
REM Usage: keep_single_arch.bat [Architecture]
setlocal
set ARCH=%1
if "%ARCH%"=="" (
echo [ERROR] Architecture must be provided
exit /b 1
)
echo Removing unnecessary architecture libraries for packaging...
REM Get the directory where this script is located
set SCRIPT_DIR=%~dp0
set LIBS_BASE_DIR=%SCRIPT_DIR%..\libs\windows
if "%ARCH%"=="x64" (
echo Removing "%LIBS_BASE_DIR%\x86" and "%LIBS_BASE_DIR%\arm64" directories
if exist "%LIBS_BASE_DIR%\x86" rd /s /q "%LIBS_BASE_DIR%\x86"
if exist "%LIBS_BASE_DIR%\arm64" rd /s /q "%LIBS_BASE_DIR%\arm64"
echo Kept x64, removed other architectures.
) else if "%ARCH%"=="x86" (
echo Removing "%LIBS_BASE_DIR%\x64" and "%LIBS_BASE_DIR%\arm64" directories
if exist "%LIBS_BASE_DIR%\x64" rd /s /q "%LIBS_BASE_DIR%\x64"
if exist "%LIBS_BASE_DIR%\arm64" rd /s /q "%LIBS_BASE_DIR%\arm64"
echo Kept x86, removed other architectures.
) else if "%ARCH%"=="arm64" (
echo Removing "%LIBS_BASE_DIR%\x64" and "%LIBS_BASE_DIR%\x86" directories
if exist "%LIBS_BASE_DIR%\x64" rd /s /q "%LIBS_BASE_DIR%\x64"
if exist "%LIBS_BASE_DIR%\x86" rd /s /q "%LIBS_BASE_DIR%\x86"
echo Kept arm64, removed other architectures.
)
endlocal