mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
Changes will default Windows SDK version as well as Platform Toolset to the default versions used in the targeted VS version. If the projects are opened up in VS2015, it should default to Windows SDK 8.1 and v140, but if the same projects are opened in VS2019, it will default to latest Windows SDK 10 and v142. This way the project files should adapt to used VS version, meaning that we could still build them using VS2015 (what's currently used on CI) but also using VS2017 and VS2019. There should not be a need to install any previous versions of build tools, unless an older version is targeted. It is also possible to set PlatformToolset when calling msbuild and that should adapt to corresponding default Windows SDK version for targeted toolset version. Commit makes many changes and adjustments, aligning all vcxproj files but changes should not affect build output.
README Last updated: 2013-01-09
Visual Studio Build Setup for Mono's Managed Code
=================================================
The scripts in this directory are used to create the various .csproj
for each one of the modules in Mono. To avoid accidentally making
changes on the Makefile system that is not reflected on the csproj
system, the .csproj files are generated from the actual Makefile
settings.
This requires a couple of steps:
* Extract the order, compiler and compilation flags for all
managed code in Mono on Linux by using the existing Makefile
system.
* Generate csproj files from the previous step
The idea is to ensure that we do not miss any compilation flag,
define, resource, reference, icon or any other element that might be
necessary to build the Mono class libraries.
* Extracting the Compilation Metadata
The first step is to extract the compilation metadata from the
existing Makefiles. This is done in stages, first a fully
working Mono compilation setup is required, and second the data
is extracted.
The extraction is done like this, from the toplevel Mono
directory run:
make update-csproj
With this input, it is possible to generate an XML file, to do
this do:
make package-inputs
This will generate order.xml, this contains the ordered list in
which directories must be compiled as well as the command line
options used to build it.
* Generate .csproj and .sln files
Run the genproj.exe executable in this directory.
On Windows:
cd msvc/scripts/
/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe genproj.csproj
./genproj.exe
On Mac:
cd msvc/scripts/
make genproj.exe
mono genproj.exe
One output of genproj is the solutions for the successive profiles,
like bcl.sln.
The command
./genproj.exe -h
lists a couple of options, notably to limit the scope of
the output solutions for each profiles to System*.dll assemblies
and dependencies.
* Compiling from Visual Studio
Before you try to compile from Visual Studio, you are *strongly*
advised to set the maximum number of parallel project builds
to 1 (Tools -> Options -> Projects and Solutions -> Build and Run)
Due to the iterative building process for some of Mono's
assemblies, there can be clashes writing to /obj/Debug for
some projects
* KNOWN ISSUES
* We do not have an "install" target, perhaps we should generate
this based on something similar to the update-csproj setup
* Audit: every Makefile for "local" changes, as those are not
visible to this tool.