Skip to content

Building on Windows

Max2 edited this page Oct 1, 2022 · 2 revisions

Visual Studio

Needed:

  • Make sure you have Visual Studio with clang-cl / llvm / clang. If you don't have it, modify your Visual Studio installation. The msh interpreter cannot be compiled with with Microsofts CL (VLA is needed, which is defined in the C99 standard, microsoft has its own "standard").

Open the project

Open the file msh.sln in project\VS with Visual Studio. Now you should see two projects:

  • devel - used to modify the sources in mshgit
  • mshgit - the main project

Before building

You have to add the corresponding all.o file to both projects. You'll find it in the folder other\<your system>. This file contains needed precompiled libraries, which I did not make public (yet).

For the language to contain commands (which are hardcoded), you need to add them using the devel project. Modify the commandline parameters in the project properties under Debug. See more to using devel at ...

Building

  • First build and execute the devel project (just click on the green play button).
  • Make sure the files in src/cparts were changed and then build the mshgit project.

Testing it

Create a text file (e.g. mshtest.txt) and write some msh code in it. The msh interpreter takes the filepath as the first parameter (it doesn't have any other parameters until now). Should you not specify a file it will search for a file named main.msh.

You could for example say:

  • mshgit.exe mshtest.txt
  • mshgit mshtext.txt

The mshgit.exe with is found in build\VS\... can be moved, copied and/or renamed as you see fit. It does not have any dependecies with the repository anymore, so you can also move it somewhere else and delete the whole source code, to save space. If you want to access the executable from anywhere on the commandline, move it to a location you want and makke sure this location is set in the PATH environment variable. Of course you can also just simply move it to the applications folder, which should already be set in the PATH.

Build using mingw

This is also good option. I will write later about it.

Clone this wiki locally