diff options
author | Johan Lorensson <lateralusx.github@gmail.com> | 2018-09-07 01:45:35 +0300 |
---|---|---|
committer | Ludovic Henry <luhenry@microsoft.com> | 2018-09-07 01:45:35 +0300 |
commit | 4acd1419c81c1caac8004b10198ef51ad1377526 (patch) | |
tree | bca2f186980765a8146790594bfdae441064f2eb /msvc/mono.props | |
parent | 16f554307f57418711d2c80bb621f7221117ce1b (diff) |
Add C++ compiler support option for some msvc build projects. (#10487)
By default, all projects are build using "default" compiler based on source
file extension. There is a property in mono.props, MONO_COMPILE_AS_CPP
that could change this and build selected projects (eglib, libgcmonosgen,
libmini, libmono-dynamic, libmono-static, libmonodac, libmonoruntime,
libmonoutils, mono, monodis, monograph and pedump) using C++ compiler.
MONO_COMPILE_AS_CPP property could be set when calling msbuild
or through VS property manager IDE. Default value is false building using
"default" compiler (current behavior). When setting MONO_COMPILE_AS_CPP=true
the build prefix will be altered to make sure the C++ build gets its own build
folder, parallel to default build folders.
Example of building using C++ compiler from msbuild:
msbuild /p:PlatformToolset=v140 /p:Platform=x64 /p:Configuration=Release /p:MONO_TARGET_GC=sgen /p:MONO_COMPILE_AS_CPP=true msvc/mono.sln
Diffstat (limited to 'msvc/mono.props')
-rw-r--r-- | msvc/mono.props | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/msvc/mono.props b/msvc/mono.props index 6098d6bf222..a673bb551b9 100644 --- a/msvc/mono.props +++ b/msvc/mono.props @@ -11,7 +11,7 @@ <MONO_TARGET_GC>sgen</MONO_TARGET_GC> <!-- When true, build targets will get a suffix based on used GC. Makes it possible to have builds using different GC's in same build folders, sharing common targets. --> <MONO_USE_TARGET_SUFFIX>true</MONO_USE_TARGET_SUFFIX> - <!-- When true, build will get a separate build folder based on used GC. Makes it possible separate builds into different output folders under the same build prefix. --> + <!-- When true, build will get a separate build folder based on various configuration parameters. Makes it possible separate builds into different output folders under the same build prefix. --> <MONO_USE_SEPARATE_BUILD_DIR>true</MONO_USE_SEPARATE_BUILD_DIR> <!-- When true, all binaries and libraries will link using static c-runtime. When false, all binaries and libraries will link using dynamic c-runtime. --> <MONO_USE_STATIC_C_RUNTIME>false</MONO_USE_STATIC_C_RUNTIME> @@ -19,6 +19,8 @@ <MONO_USE_STATIC_LIBMONO>false</MONO_USE_STATIC_LIBMONO> <!-- When true, mono binaries will link and include llvm. When false, mono binaries will not link and include llvm. --> <MONO_ENABLE_LLVM>false</MONO_ENABLE_LLVM> + <!-- When true, ported mono projects will build using C++ instead of C compiler. When false, all project will be build using the default compiler. --> + <MONO_COMPILE_AS_CPP>false</MONO_COMPILE_AS_CPP> </PropertyGroup> <PropertyGroup Label="MonoDirectories"> <MonoSourceLocation Condition="'$(MonoSourceLocation)' == '' ">..</MonoSourceLocation> @@ -52,14 +54,16 @@ <GC_DEFINES>$(SGEN_DEFINES)</GC_DEFINES> <GC_LIB>libgcmonosgen.lib</GC_LIB> <MONO_TARGET_SUFFIX Condition="'$(MONO_USE_TARGET_SUFFIX)'=='true'">-sgen</MONO_TARGET_SUFFIX> - <MONO_BUILD_DIR_PREFIX Condition="'$(MONO_USE_SEPARATE_BUILD_DIR)'=='true'">$(MONO_BUILD_DIR_PREFIX)sgen/</MONO_BUILD_DIR_PREFIX> + <MONO_BUILD_DIR_PREFIX Condition="'$(MONO_USE_SEPARATE_BUILD_DIR)'=='true' And '$(MONO_COMPILE_AS_CPP)'!='true'">$(MONO_BUILD_DIR_PREFIX)sgen/</MONO_BUILD_DIR_PREFIX> + <MONO_BUILD_DIR_PREFIX Condition="'$(MONO_USE_SEPARATE_BUILD_DIR)'=='true' And '$(MONO_COMPILE_AS_CPP)'=='true'">$(MONO_BUILD_DIR_PREFIX)sgen-cpp/</MONO_BUILD_DIR_PREFIX> </PropertyGroup> <PropertyGroup Label="MonoBOEHM" Condition="$(MONO_TARGET_GC)=='boehm'"> <BOEHM_DEFINES>HAVE_BOEHM_GC</BOEHM_DEFINES> <GC_DEFINES>$(BOEHM_DEFINES)</GC_DEFINES> <GC_LIB>libgc.lib</GC_LIB> <MONO_TARGET_SUFFIX Condition="'$(MONO_USE_TARGET_SUFFIX)'=='true'">-boehm</MONO_TARGET_SUFFIX> - <MONO_BUILD_DIR_PREFIX Condition="'$(MONO_USE_SEPARATE_BUILD_DIR)'=='true'">$(MONO_BUILD_DIR_PREFIX)boehm/</MONO_BUILD_DIR_PREFIX> + <MONO_BUILD_DIR_PREFIX Condition="'$(MONO_USE_SEPARATE_BUILD_DIR)'=='true'And '$(MONO_COMPILE_AS_CPP)'!='true'">$(MONO_BUILD_DIR_PREFIX)boehm/</MONO_BUILD_DIR_PREFIX> + <MONO_BUILD_DIR_PREFIX Condition="'$(MONO_USE_SEPARATE_BUILD_DIR)'=='true'And '$(MONO_COMPILE_AS_CPP)'=='true'">$(MONO_BUILD_DIR_PREFIX)boehm-cpp/</MONO_BUILD_DIR_PREFIX> </PropertyGroup> <PropertyGroup Label="Static-Mono-Libraries"> <MONO_RUNTIME_LIBS>libmonoutils.lib;libmonoruntime$(MONO_TARGET_SUFFIX).lib;libmini$(MONO_TARGET_SUFFIX).lib;$(GC_LIB)</MONO_RUNTIME_LIBS> @@ -109,6 +113,9 @@ <BuildMacro Include="MONO_ENABLE_LLVM"> <Value>$(MONO_ENABLE_LLVM)</Value> </BuildMacro> + <BuildMacro Include="MONO_COMPILE_AS_CPP"> + <Value>$(MONO_COMPILE_AS_CPP)</Value> + </BuildMacro> </ItemGroup> <PropertyGroup Label="MonoDefaultPreprocessorDefinitions"> <MONO_PREPROCESSOR_DEFINITIONS>__default_codegen__;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;GC_NOT_DLL;WIN32_THREADS;WINVER=0x0601;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;_UNICODE;UNICODE;FD_SETSIZE=1024;NVALGRIND;$(MONO_ADDITIONAL_PREPROCESSOR_DEFINITIONS)</MONO_PREPROCESSOR_DEFINITIONS> |