- 4
[Guide]: Lightweight compiler for Windows for replacement heavy Visual Studio IDE. Compile rAthena faster. Save your bandwidth and disk space.
For what are you need Visual Studio?
134 members have voted
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
anacondaq
Problem
Please open the link and read https://github.com/rathena/rathena/pull/2089
tl;tr VS2008, VS2010 solutions no more available after upgrade above. I'm not against these changes, but they create some problems that are described in comments in the link above and in the images below.
My little "cry story", which affects many users, and main ideas has been explained there: https://github.com/rathena/rathena/pull/2089
Solution
1.91GB data instead of 9.1GB data to download / store on HDD just for doing the same task (compiling) is not it good?
Something like this looks this tool, and on the screenshot above you see that login, char, map server and others projects inside solution has been successfully built.
What is it?
This is Visual Studio C++ Build Tools. Detailed information what is it you can read here: https://msdn.microsoft.com/en-us/library/dd293626.aspx
This is just a set of console apps as the compiler, linker, etc. Without heavy Visual Studio IDE which does its job pretty well.
You can save up to 4-5x times internet bandwidth and space at disk.
For whom is this?
I think this guide will be useful for all who has only one goal - compile rAthena source code on Windows and run it.
For people who wish to save some data, and internet bandwidth. Who don't develop new features for rAthena, because IDE much better for this purposes.
Pros of VS 2017 C++ Build Tools:
Cons of VS 2017 C++ Build Tools:
Guide how to compile rAthena on Windows
How to compile rAthena without Visual Studio IDE but by Visual Studio C++ Building Tools?
It's very easy, let me follow you though mini-guide which will require few actions from you.
1. Go Here: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017/
download Building Tools for Visual Studio 2017, then run it
2. Go to Individual Components and select next checkboxes:
This is minimal package of things what need to install to make compilation works, either you will have tons of errors when will try to compile a code.
This minimal package has been tested and verified on Win10x64 and works great. Nothing extra, only most important components.
3. Let's try to compile your server (rAthena source code (rAthena.sln))
Mini-theory what you need to know. You will build whole solution (rAthena.sln) via MSBuild via command line by entering next format
As I remember MSBuild not added to "path", so just calling from command line "MSBuild" command not enough, for that need or create .bat file, or call it manually via terminal (console)
If you don't want to read details below, you can stop here, and download "compile.bat", then copy the file to your rAthena folder and run it.
After this you will see console window inside what you will be able to see compilation output. Then when process will be finished, you will get compiled rAthena exe's in rAthena emulator folder from where you have been ran "compile.bat" file.
Or here is raw code from compile.bat you can copy-paste it to text editor then save your file as 'compile bat' and copy the file to your rAthena folder
@Echo OFF Echo "Building solution/project file using batch file" SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin SET SolutionPath=%~dp0\rAthena.sln Echo Start Time - %Time% MSbuild.exe %SolutionPath% /p:PlatformToolset=v141 /m Echo End Time - %Time% Set /p Wait=Build Process Completed...
If you don't want to use .bat file, you can always launch compilation via next combination of actions
Click "Run Start (Windows button)" - find in Start Menu - Developer Command Prompt for VS 2017, and then run it.
Inside opened console app, enter next command:
MSBUILD C:\user\admin\desktop\rathena\rAthena.sln /p:PlatformToolset=v141 /m
Where path you must set by yourself (where is located your rAthena.sln)
About /p:PlatformToolset=v141. By default rAthena solution file developed for VS2013, and VS2013 uses v120 toolset. This toolset available only with Visual Studio 2013, and this toolset impossible to install for this VS Building Tools. So, we have installed v141 toolset and we will use it. And we don't need to edit any config files to update our solution (like in rAthena guide what you can read at topic about rAthena solution upgrade). So, don't remove this parameter, and always have it as an argument, either you will not be able to compile solution and will see million of errors.
About /m - this is the optional parameter, you can not use it if don't wish (/m parameter makes compilation much faster).
When you will enter it, MSBuild will compile source code in console and will print you about any warnings / errors during compilation (like you see in Visual Studio IDE). When it will finish, you will see results, something like this
Useful commands And Links
Build / Re-build Project:
or if you wish to build faster try add /m flag too
Clean Solution:
Information about MSBuild:
https://msdn.microsoft.com/en-us/library/dd293626.aspx/
That's all, hope it's enough, and I have helped someone.
Edited by AnacondaqqLink to comment
Share on other sites
32 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.