mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-04 12:58:41 +00:00
changed build.bat to handle extra natvis for radlink and removed
'Unset' part since we use setlocal that prevents local variable from leaking to the environment.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal
|
setlocal enabledelayedexpansion
|
||||||
cd /D "%~dp0"
|
cd /D "%~dp0"
|
||||||
|
|
||||||
:: --- Usage Notes (2024/1/10) ------------------------------------------------
|
:: --- Usage Notes (2024/1/10) ------------------------------------------------
|
||||||
@@ -48,11 +48,21 @@ set cl_debug= call cl /Od /Ob1 /DBUILD_DEBUG=1 %cl_common% %auto_compile_fl
|
|||||||
set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% %auto_compile_flags%
|
set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% %auto_compile_flags%
|
||||||
set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags%
|
set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags%
|
||||||
set clang_release= call clang -g -O2 -DBUILD_DEBUG=0 %clang_common% %auto_compile_flags%
|
set clang_release= call clang -g -O2 -DBUILD_DEBUG=0 %clang_common% %auto_compile_flags%
|
||||||
set cl_link= /link /MANIFEST:EMBED /INCREMENTAL:NO /natvis:"%~dp0\src\natvis\base.natvis" /pdbaltpath:%%%%_PDB%%%%
|
set cl_link= /link /MANIFEST:EMBED /INCREMENTAL:NO /pdbaltpath:%%%%_PDB%%%%
|
||||||
set clang_link= -fuse-ld=lld -Xlinker /MANIFEST:EMBED -Xlinker /natvis:"%~dp0\src\natvis\base.natvis" -Xlinker /pdbaltpath:%%%%_PDB%%%%
|
set clang_link= -fuse-ld=lld -Xlinker /MANIFEST:EMBED -Xlinker /pdbaltpath:%%%%_PDB%%%%
|
||||||
set cl_out= /out:
|
set cl_out= /out:
|
||||||
set clang_out= -o
|
set clang_out= -o
|
||||||
|
|
||||||
|
:: --- NATVIS -----------------------------------------------------------------
|
||||||
|
set natvis= /NATVIS:"%~dp0\src\natvis\base.natvis"
|
||||||
|
if "%radlink%"=="1" set natvis= %natvis% /NATVIS:"%~dp0\src\linker\linker.natvis"
|
||||||
|
|
||||||
|
if "%clang%"=="1" (
|
||||||
|
set result=
|
||||||
|
for %%n in (%natvis%) do set result= !result! -Xlinker %%n
|
||||||
|
set natvis= !result!
|
||||||
|
)
|
||||||
|
|
||||||
:: --- Per-Build Settings -----------------------------------------------------
|
:: --- Per-Build Settings -----------------------------------------------------
|
||||||
set link_dll=-DLL
|
set link_dll=-DLL
|
||||||
set link_icon=logo.res
|
set link_icon=logo.res
|
||||||
@@ -77,6 +87,9 @@ if "%clang%"=="1" set out=%clang_out%
|
|||||||
if "%debug%"=="1" set compile=%compile_debug%
|
if "%debug%"=="1" set compile=%compile_debug%
|
||||||
if "%release%"=="1" set compile=%compile_release%
|
if "%release%"=="1" set compile=%compile_release%
|
||||||
|
|
||||||
|
:: --- Append NATVIS to link line ---------------------------------------------
|
||||||
|
set compile_link= %compile_link% %natvis%
|
||||||
|
|
||||||
:: --- Prep Directories -------------------------------------------------------
|
:: --- Prep Directories -------------------------------------------------------
|
||||||
if not exist build mkdir build
|
if not exist build mkdir build
|
||||||
if not exist local mkdir local
|
if not exist local mkdir local
|
||||||
@@ -102,7 +115,7 @@ if not "%no_meta%"=="1" (
|
|||||||
:: --- Build Everything (@build_targets) --------------------------------------
|
:: --- Build Everything (@build_targets) --------------------------------------
|
||||||
pushd build
|
pushd build
|
||||||
if "%raddbg%"=="1" set didbuild=1 && %compile% ..\src\raddbg\raddbg_main.c %compile_link% %link_icon% %out%raddbg.exe || exit /b 1
|
if "%raddbg%"=="1" set didbuild=1 && %compile% ..\src\raddbg\raddbg_main.c %compile_link% %link_icon% %out%raddbg.exe || exit /b 1
|
||||||
if "%radlink%"=="1" set didbuild=1 && %compile% ..\src\linker\lnk.c %compile_link% %out%radlink.exe /NATVIS:..\src\linker\linker.natvis || exit /b 1
|
if "%radlink%"=="1" set didbuild=1 && %compile% ..\src\linker\lnk.c %compile_link% %out%radlink.exe || exit /b 1
|
||||||
if "%rdi_from_pdb%"=="1" set didbuild=1 && %compile% ..\src\rdi_from_pdb\rdi_from_pdb_main.c %compile_link% %out%rdi_from_pdb.exe || exit /b 1
|
if "%rdi_from_pdb%"=="1" set didbuild=1 && %compile% ..\src\rdi_from_pdb\rdi_from_pdb_main.c %compile_link% %out%rdi_from_pdb.exe || exit /b 1
|
||||||
if "%rdi_from_dwarf%"=="1" set didbuild=1 && %compile% ..\src\rdi_from_dwarf\rdi_from_dwarf.c %compile_link% %out%rdi_from_dwarf.exe || exit /b 1
|
if "%rdi_from_dwarf%"=="1" set didbuild=1 && %compile% ..\src\rdi_from_dwarf\rdi_from_dwarf.c %compile_link% %out%rdi_from_dwarf.exe || exit /b 1
|
||||||
if "%rdi_dump%"=="1" set didbuild=1 && %compile% ..\src\rdi_dump\rdi_dump_main.c %compile_link% %out%rdi_dump.exe || exit /b 1
|
if "%rdi_dump%"=="1" set didbuild=1 && %compile% ..\src\rdi_dump\rdi_dump_main.c %compile_link% %out%rdi_dump.exe || exit /b 1
|
||||||
@@ -124,16 +137,6 @@ if "%mule_peb_trample%"=="1" (
|
|||||||
)
|
)
|
||||||
popd
|
popd
|
||||||
|
|
||||||
:: --- Unset ------------------------------------------------------------------
|
|
||||||
for %%a in (%*) do set "%%a=0"
|
|
||||||
set raddbg=
|
|
||||||
set compile=
|
|
||||||
set compile_link=
|
|
||||||
set out=
|
|
||||||
set msvc=
|
|
||||||
set debug=
|
|
||||||
set release=
|
|
||||||
|
|
||||||
:: --- Warn On No Builds ------------------------------------------------------
|
:: --- Warn On No Builds ------------------------------------------------------
|
||||||
if "%didbuild%"=="" (
|
if "%didbuild%"=="" (
|
||||||
echo [WARNING] no valid build target specified; must use build target names as arguments to this script, like `build raddbg` or `build rdi_from_pdb`.
|
echo [WARNING] no valid build target specified; must use build target names as arguments to this script, like `build raddbg` or `build rdi_from_pdb`.
|
||||||
|
|||||||
Reference in New Issue
Block a user