You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
better/build.bat

50 lines
1.3 KiB

@echo off
setlocal
if [%1] == [release] (
echo Building for release...
set TargetCFlags=/MT /O2 /GL /D NDEBUG /D BETTER_DEBUG=0
) else (
echo Building for debug...
set TargetCFlags=/MTd /Zi /Zf /Od /fsanitize=address /D BETTER_DEBUG=1
)
if exist build\ rmdir /S /Q build\
mkdir build\
set CommonCFlags=/nologo /MP /std:c++17 /W3 /EHsc ^
/Febuild\better.exe /Fobuild\ /Fdbuild\ ^
/D UNICODE /D _UNICODE /D IMGUI_IMPL_WIN32_DISABLE_GAMEPAD /D IMGUI_USE_STB_SPRINTF ^
/Isrc ^
/Ilib ^
/Ilib\imgui ^
/Ilib\imgui\backends ^
/Ilib\implot ^
/Ilib\binn\src ^
/Ilib\cregex
set CommonLFlags=build\better.res d3d11.lib ws2_32.lib crypt32.lib shell32.lib advapi32.lib
rc /nologo /fobuild\better.res resources\better.rc
if errorlevel 1 (
echo Resource compilation failed.
) else (
echo Resource compilation successful.
cl src\*.cpp src\*.c ^
lib\imgui\*.cpp ^
lib\imgui\backends\imgui_impl_dx11.cpp ^
lib\imgui\backends\imgui_impl_win32.cpp ^
lib\implot\implot.cpp ^
lib\implot\implot_items.cpp ^
lib\cregex\*.c ^
%CommonCFlags% %TargetCFlags% ^
/link %CommonLFlags%
if errorlevel 1 (
echo Build failed.
) else (
xcopy /Q /Y data build\
echo Build successful.
)
)