forked from bitcoin-core/secp256k1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean_ucrt64_inline_test.bat
More file actions
60 lines (47 loc) · 2.15 KB
/
Copy pathclean_ucrt64_inline_test.bat
File metadata and controls
60 lines (47 loc) · 2.15 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
50
51
52
53
54
55
56
57
58
59
60
@echo off
setlocal EnableDelayedExpansion
echo Testing UCRT64 compiler access from mingw64 environment without popup windows
echo ================================================================================
REM Create a simple test C file
echo #include ^<stdio.h^> > test_simple.c
echo int main^(^) { >> test_simple.c
echo printf^(^"Hello from UCRT64 compiler!\\\\n^"^); >> test_simple.c
echo return 0; >> test_simple.c
echo } >> test_simple.c
echo Created test file:
type test_simple.c
echo.
REM Check for MSYS2 installation
if not exist "C:\msys64\usr\bin\bash.exe" (
echo Error: MSYS2 not found at C:\msys64
exit /b 1
)
echo Found MSYS2 installation
echo.
REM Convert path for MSYS2
set "WIN_PATH=%CD%"
set "MSYS_PATH=!WIN_PATH:\=/!"
set "MSYS_PATH=!MSYS_PATH:C:=/c!"
echo Using path: !MSYS_PATH!
echo.
echo Calling UCRT64 compiler inline from mingw64 environment...
echo.
REM Execute compilation inline (no new window) using UCRT64 compiler
"C:\msys64\usr\bin\bash.exe" -l -c "cd '!MSYS_PATH!' && echo 'In bash, compiling with UCRT64 compiler:' && /ucrt64/bin/gcc -v test_simple.c -o test_simple.exe && echo 'Compilation successful' && echo 'File details:' && ls -la test_simple.exe && echo 'Running test program:' && ./test_simple.exe"
set EXIT_CODE=!errorlevel!
echo.
if !EXIT_CODE! equ 0 (
echo SUCCESS: C file successfully compiled with UCRT64 compiler called from mingw64 environment
echo This demonstrates the proper inline calling method without popup windows
) else (
echo NOTE: Exit code !EXIT_CODE! - likely just means program executed and returned the exit code from main^(^)
echo Verifying that the executable was created:
"C:\msys64\usr\bin\bash.exe" -l -c "cd '!MSYS_PATH!' && if [ -f './test_simple.exe' ]; then echo 'Executable test_simple.exe exists - compilation was successful'; else echo 'Executable not found - compilation failed'; fi"
)
echo.
echo Cleanup: Removing test files
if exist "test_simple.c" del "test_simple.c" 2>nul
if exist "test_simple.exe" del "test_simple.exe" 2>nul
echo.
echo Test completed successfully - demonstrating UCRT64 compiler access from mingw64 environment
echo without creating any popup windows.