Skip to content

Instantly share code, notes, and snippets.

@rondreas
Created December 14, 2021 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rondreas/fe621fa698244dda67137b4f8386c2ad to your computer and use it in GitHub Desktop.
Save rondreas/fe621fa698244dda67137b4f8386c2ad to your computer and use it in GitHub Desktop.
Thank you handmade hero for making it easier to compile stuff
@echo off
REM adds cl.exe to path
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64
REM Set current dir to folder of this script
pushd %~dp0
REM Then create and cd into build folder
mkdir build
pushd build
REM /I - additional include directories
REM /c - compile without linking
REM /EHsc - Exception handling model. sc - compiler will assume functions declared as extern C never throw C++ exceptions
cl.exe /I ..\include /c /EHsc ..\common\*.cpp
lib.exe /OUT:lxsdk.lib *.obj
REM cd .. to the original folder
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment