<commit_before>
@echo off

setlocal

::
:: Search for the location of Visual Studio
::
if DEFINED VS110COMNTOOLS (
	set "VS_TOOLS_DIR=%VS110COMNTOOLS%"
) else if DEFINED VS100COMNTOOLS (
	set "VS_TOOLS_DIR=%VS100COMNTOOLS%"
) else if DEFINED VS90COMNTOOLS (
	set "VS_TOOLS_DIR=%VS90COMNTOOLS%"
) else if DEFINED VS80COMNTOOLS (
	set "VS_TOOLS_DIR=%VS80COMNTOOLS%"
) else (
	echo Microsoft Visual Studio not found
	exit
)


::
:: Apply environment necessary to use cl.exe
::
set VC_DIR=%VS_TOOLS_DIR%..\..\VC
call "%VC_DIR%\vcvarsall.bat"

::
:: Search for the windows SDK
::
set KEY_NAME="HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows"
set VALUE_NAME=CurrentInstallFolder
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
	set "ValueName=%%A"
	set "ValueType=%%B"
	set WINDOWS_SDK_DIR=%%C
)
if not defined WINDOWS_SDK_DIR (
	echo %KEY_NAME%\%VALUE_NAME% not found.
	exit
)


::
:: Unconditional compile/link of all files
::
set SRC=%~dp0/src
set DEP=%~dp0/../lib
set OUT=%~dp0/bin
cl.exe %SRC%/cbpp.cpp /EHsc /nologo /Fo%OUT%/cbpp.obj /c
cl.exe %SRC%/ComputeProcessor.cpp /EHsc /nologo /Fo%OUT%/ComputeProcessor.obj /c
cl.exe %DEP%/ComputeParser.c /EHsc /nologo /Fo%OUT%/ComputeParser.obj /c
link.exe /LIBPATH:"%WINDOWS_SDK_DIR%lib" /OUT:%OUT%/cbpp.exe %OUT%/cbpp %OUT%/ComputeProcessor %OUT%/ComputeParser<commit_msg>Allow debug builds.<commit_after>
@echo off

setlocal

::
:: Search for the location of Visual Studio
::
if DEFINED VS110COMNTOOLS (
	set "VS_TOOLS_DIR=%VS110COMNTOOLS%"
) else if DEFINED VS100COMNTOOLS (
	set "VS_TOOLS_DIR=%VS100COMNTOOLS%"
) else if DEFINED VS90COMNTOOLS (
	set "VS_TOOLS_DIR=%VS90COMNTOOLS%"
) else if DEFINED VS80COMNTOOLS (
	set "VS_TOOLS_DIR=%VS80COMNTOOLS%"
) else (
	echo Microsoft Visual Studio not found
	exit
)


::
:: Apply environment necessary to use cl.exe
::
set VC_DIR=%VS_TOOLS_DIR%..\..\VC
call "%VC_DIR%\vcvarsall.bat"

::
:: Search for the windows SDK
::
set KEY_NAME="HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows"
set VALUE_NAME=CurrentInstallFolder
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
	set "ValueName=%%A"
	set "ValueType=%%B"
	set WINDOWS_SDK_DIR=%%C
)
if not defined WINDOWS_SDK_DIR (
	echo %KEY_NAME%\%VALUE_NAME% not found.
	exit
)


set CL_FLAGS=
set LINK_FLAGS=
if "%1"=="debug" (
	set CL_FLAGS=/Zi
	set LINK_FLAGS=/DEBUG
)


::
:: Unconditional compile/link of all files
::
set SRC=%~dp0/src
set DEP=%~dp0/../lib
set OUT=%~dp0/bin
cl.exe %SRC%/cbpp.cpp /EHsc /nologo /Fo%OUT%/cbpp.obj /c %CL_FLAGS%
cl.exe %SRC%/ComputeProcessor.cpp /EHsc /nologo /Fo%OUT%/ComputeProcessor.obj /c %CL_FLAGS%
cl.exe %DEP%/ComputeParser.c /EHsc /nologo /Fo%OUT%/ComputeParser.obj /c %CL_FLAGS%
link.exe %LINK_FLAGS% /LIBPATH:"%WINDOWS_SDK_DIR%lib" /OUT:%OUT%/cbpp.exe %OUT%/cbpp %OUT%/ComputeProcessor %OUT%/ComputeParser
{'fraction_non_alphanumeric': 0.1487143849895761, 'fraction_numerical': 0.01911049339819319, 'mean_word_length': 4.973029045643154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7275417', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1202, 'n_words': 267}