-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bat
More file actions
36 lines (29 loc) · 1.04 KB
/
Copy pathbuild.bat
File metadata and controls
36 lines (29 loc) · 1.04 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
@echo off
title TianCan V1.0 Core Build Tool
where cl >nul 2>nul
if errorlevel 1 (
echo [!] ERROR: MSVC compiler cl.exe not found.
echo [!] Please run this script in "x64 Native Tools Command Prompt".
pause
exit /b
)
echo [*] Auto-detecting Python environment...
for /f "tokens=*" %%i in ('python -c "import sys, os; print(os.path.join(sys.base_prefix, 'include'))"') do set "PY_INC=%%i"
for /f "tokens=*" %%i in ('python -c "import sys, os; print(os.path.join(sys.base_prefix, 'libs'))"') do set "PY_LIB=%%i"
if "%PY_INC%"=="" (
echo [!] ERROR: Python environment not found.
pause
exit /b
)
echo [+] Detected Include Path: "%PY_INC%"
echo [+] Detected Libs Path: "%PY_LIB%"
if exist security.pyd del /f /q security.pyd
if exist security.obj del /f /q security.obj
echo [*] Forging security.pyd...
cl /LD security.c /I "%PY_INC%" /link /LIBPATH:"%PY_LIB%" /INCREMENTAL:NO /OUT:security.pyd >nul
if exist security.pyd (
echo [OK] Build Successful! security.pyd generated.
) else (
echo [FAIL] Compilation failed.
)
pause