diff options
author | Johan Lorensson <lateralusx.github@gmail.com> | 2018-06-25 09:34:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 09:34:11 +0300 |
commit | 901e4f6cf187130526cafd75d71c44e623242c36 (patch) | |
tree | c7c1a9b3bb3595d34b22172467f1495b6ee373a1 /msvc | |
parent | b14af0f14e8c01cbcd0e11237cd38adaba4ad03f (diff) | |
parent | a86b6c19fe93e8afd6d940a6a823a3f9795cb614 (diff) |
Merge pull request #9230 from lateralusX/lateralusX/windows-x64-llvm-support-master
Add LLVM AOT/Full AOT support on Windows x64.
Diffstat (limited to 'msvc')
-rw-r--r-- | msvc/build-init.vcxproj | 38 | ||||
-rw-r--r-- | msvc/build-init.vcxproj.filters | 1 | ||||
-rw-r--r-- | msvc/libmini-llvm.targets | 13 | ||||
-rw-r--r-- | msvc/libmini.vcxproj | 8 | ||||
-rw-r--r-- | msvc/libmono-dynamic.vcxproj | 20 | ||||
-rw-r--r-- | msvc/llvm-cmake-config.bat | 52 | ||||
-rw-r--r-- | msvc/mono.props | 26 | ||||
-rw-r--r-- | msvc/mono.vcxproj | 16 |
8 files changed, 141 insertions, 33 deletions
diff --git a/msvc/build-init.vcxproj b/msvc/build-init.vcxproj index e4bd714670e..46b4b18a967 100644 --- a/msvc/build-init.vcxproj +++ b/msvc/build-init.vcxproj @@ -20,7 +20,6 @@ </ItemGroup>
<ItemGroup>
<ClInclude Include="..\config.h" />
- <ClInclude Include="..\eglib\config.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{92AE7622-5F58-4234-9A26-9EC71876B3F4}</ProjectGuid>
@@ -99,7 +98,8 @@ <SDLCheck>true</SDLCheck>
</ClCompile>
<PostBuildEvent>
- <Command>winsetup.bat</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -109,7 +109,8 @@ <SDLCheck>true</SDLCheck>
</ClCompile>
<PostBuildEvent>
- <Command>winsetup.bat</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -125,7 +126,8 @@ <OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
- <Command>winsetup.bat</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -141,10 +143,36 @@ <OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
- <Command>winsetup.bat</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
+ <PropertyGroup Label="LLVMProperties" Condition="$(MONO_ENABLE_LLVM)=='true'">
+ <LLVMConfig>$(MONO_LLVM_BIN_DIR)/llvm-config.exe</LLVMConfig>
+ </PropertyGroup>
+ <Target Name="AfterBuildWinSetup">
+ <Exec Command="winsetup.bat">
+ <Output TaskParameter="ExitCode" PropertyName="WinSetupExitCode" />
+ </Exec>
+ <Error Text="Failed running winsetup.bat" Condition="$(WinSetupExitCode) != 0" />
+ </Target>
+ <Target Name="AfterBuildLLVMSetup" Condition="$(MONO_ENABLE_LLVM)=='true'">
+ <Message Importance="high" Text="Validating LLVM configuration..." />
+ <Error Text="LLVM executable $(LLVMConfig) not found." Condition="!Exists($(LLVMConfig))" />
+ <Message Importance="high" Text="LLVM Version:" />
+ <Exec Command="$(MONO_LLVM_BIN_DIR)/llvm-config.exe --version" ConsoleToMSBuild="true">
+ <Output TaskParameter="ConsoleOutput" PropertyName="MonoLLVMVersion" />
+ </Exec>
+ <Message Importance="high" Text="LLVM API Version:" />
+ <Exec Command="$(MONO_LLVM_BIN_DIR)/llvm-config.exe --mono-api-version" ConsoleToMSBuild="true" EchoOff="true">
+ <Output TaskParameter="ConsoleOutput" PropertyName="MonoLLVMAPIVersion" />
+ </Exec>
+ <Error Text="Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm." Condition="!$(MonoLLVMVersion.Contains('mono'))" />
+ <Error Text="Expected llvm version 4, but llvm-config --version returned $(MonoLLVMAPIVersion)." Condition="$(MonoLLVMAPIVersion) != '4'" />
+ <Message Importance="high" Text="Successfully validated LLVM configuration." />
+ </Target>
+ <Target Name="AfterBuild" DependsOnTargets="AfterBuildWinSetup;AfterBuildLLVMSetup" />
</Project>
\ No newline at end of file diff --git a/msvc/build-init.vcxproj.filters b/msvc/build-init.vcxproj.filters index bcde289799b..4cdc322a7b1 100644 --- a/msvc/build-init.vcxproj.filters +++ b/msvc/build-init.vcxproj.filters @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
- <ClInclude Include="..\eglib\config.h" />
<ClInclude Include="..\config.h" />
</ItemGroup>
</Project>
\ No newline at end of file diff --git a/msvc/libmini-llvm.targets b/msvc/libmini-llvm.targets index f4b6737f6f4..47ecbde4416 100644 --- a/msvc/libmini-llvm.targets +++ b/msvc/libmini-llvm.targets @@ -1,23 +1,24 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> - <ExcludeFromWindowsBuild>true</ExcludeFromWindowsBuild> + <ExcludeLLVMFromWindowsBuild Condition="'$(MONO_ENABLE_LLVM)'=='true'">false</ExcludeLLVMFromWindowsBuild> + <ExcludeLLVMFromWindowsBuild Condition="'$(MONO_ENABLE_LLVM)'=='' Or '$(MONO_ENABLE_LLVM)'!='true'">true</ExcludeLLVMFromWindowsBuild> </PropertyGroup> <ItemGroup Label="llvm_sources"> <ClCompile Include="$(MonoSourceLocation)\mono\mini\mini-llvm-loaded.c"> - <ExcludedFromBuild>$(ExcludeFromWindowsBuild)</ExcludedFromBuild> + <ExcludedFromBuild>$(ExcludeLLVMFromWindowsBuild)</ExcludedFromBuild> </ClCompile> <ClCompile Include="$(MonoSourceLocation)\mono\mini\mini-llvm.c"> - <ExcludedFromBuild>$(ExcludeFromWindowsBuild)</ExcludedFromBuild> + <ExcludedFromBuild>$(ExcludeLLVMFromWindowsBuild)</ExcludedFromBuild> </ClCompile> <ClCompile Include="$(MonoSourceLocation)\mono\mini\llvm-runtime.cpp"> - <ExcludedFromBuild>$(ExcludeFromWindowsBuild)</ExcludedFromBuild> + <ExcludedFromBuild>$(ExcludeLLVMFromWindowsBuild)</ExcludedFromBuild> </ClCompile> <ClCompile Include="$(MonoSourceLocation)\mono\mini\mini-llvm-cpp.cpp"> - <ExcludedFromBuild>$(ExcludeFromWindowsBuild)</ExcludedFromBuild> + <ExcludedFromBuild>$(ExcludeLLVMFromWindowsBuild)</ExcludedFromBuild> </ClCompile> <ClCompile Include="$(MonoSourceLocation)\mono\mini\llvm-jit.cpp"> - <ExcludedFromBuild>$(ExcludeFromWindowsBuild)</ExcludedFromBuild> + <ExcludedFromBuild>$(ExcludeLLVMFromWindowsBuild)</ExcludedFromBuild> </ClCompile> </ItemGroup> </Project> diff --git a/msvc/libmini.vcxproj b/msvc/libmini.vcxproj index 63f573ac737..62e9def9d79 100644 --- a/msvc/libmini.vcxproj +++ b/msvc/libmini.vcxproj @@ -100,7 +100,7 @@ <ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);$(MONO_LLVM_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -125,7 +125,7 @@ <ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);$(MONO_LLVM_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;WIN64;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -150,7 +150,7 @@ <ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);$(MONO_LLVM_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -176,7 +176,7 @@ <ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);$(MONO_LLVM_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;WIN64;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
diff --git a/msvc/libmono-dynamic.vcxproj b/msvc/libmono-dynamic.vcxproj index 186bd7ffc31..21e64c3495d 100644 --- a/msvc/libmono-dynamic.vcxproj +++ b/msvc/libmono-dynamic.vcxproj @@ -97,7 +97,7 @@ <ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);$(MONO_LLVM_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;$(GC_DEFINES);MONO_DLL_EXPORT;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -114,12 +114,13 @@ </ProjectReference>
<Link>
<AdditionalDependencies Condition="'$(MONO_TARGET_GC)'=='boehm'">$(GC_LIB);%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(MONO_LLVM_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(MONO_BUILD_DIR_PREFIX)$(Platform)\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
+ <AdditionalDependencies>$(MONO_LLVM_LIBS);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>.\libmono.bat "$(MONO_INCLUDE_DIR)" "$(SolutionDir)include\mono" -q</Command>
@@ -136,7 +137,7 @@ <ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);$(MONO_LLVM_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;$(GC_DEFINES);MONO_DLL_EXPORT;WIN64;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -153,10 +154,11 @@ </ProjectReference>
<Link>
<AdditionalDependencies Condition="'$(MONO_TARGET_GC)'=='boehm'">$(GC_LIB);%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(MONO_LLVM_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<ImportLibrary>$(MONO_BUILD_DIR_PREFIX)$(Platform)\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
+ <AdditionalDependencies>$(MONO_LLVM_LIBS);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>.\libmono.bat "$(MONO_INCLUDE_DIR)" "$(SolutionDir)include\mono" -q</Command>
@@ -170,7 +172,7 @@ <ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);$(MONO_LLVM_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;$(GC_DEFINES);MONO_DLL_EXPORT;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<PrecompiledHeader>
@@ -184,12 +186,13 @@ <ProjectReference />
<Link>
<AdditionalDependencies Condition="'$(MONO_TARGET_GC)'=='boehm'">$(GC_LIB);%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(MONO_LLVM_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(MONO_BUILD_DIR_PREFIX)$(Platform)\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
+ <AdditionalDependencies>$(MONO_LLVM_LIBS);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>.\libmono.bat "$(MONO_INCLUDE_DIR)" "$(SolutionDir)include\mono" -q</Command>
@@ -209,7 +212,7 @@ <ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(LIBGC_CPPFLAGS_INCLUDE);$(GLIB_CFLAGS_INCLUDE);$(MONO_LLVM_INCLUDE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;$(GC_DEFINES);MONO_DLL_EXPORT;WIN64;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<PrecompiledHeader>
@@ -223,10 +226,11 @@ <ProjectReference />
<Link>
<AdditionalDependencies Condition="'$(MONO_TARGET_GC)'=='boehm'">$(GC_LIB);%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(MONO_LLVM_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<ImportLibrary>$(MONO_BUILD_DIR_PREFIX)$(Platform)\lib\$(Configuration)\$(TargetName).lib</ImportLibrary>
+ <AdditionalDependencies>$(MONO_LLVM_LIBS);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>.\libmono.bat "$(MONO_INCLUDE_DIR)" "$(SolutionDir)include\mono" -q</Command>
diff --git a/msvc/llvm-cmake-config.bat b/msvc/llvm-cmake-config.bat new file mode 100644 index 00000000000..43bf8d6b58a --- /dev/null +++ b/msvc/llvm-cmake-config.bat @@ -0,0 +1,52 @@ +@ECHO OFF
+
+SET TEMP_PATH=%PATH%
+
+REM Update PATH to include local cmake and phython installations.
+REM SET PATH="C:\tools\cmake-3.10.2-win32-x86\bin";"C:\tools\python2.2.7.15\tools\";%PATH%
+
+SET TOP=%1 +IF "" == "%TOP%" ( + ECHO Error, first script parameter should be LLVM source folder. + GOTO ON_ERROR +) + +IF NOT EXIST "%TOP%" ( + ECHO Error, could not find "%TOP%". + GOTO ON_ERROR +)
+
+IF NOT EXIST "%~dp0mono.sln" (
+ ECHO Error, script bust be located in same directory as mono.sln file. + GOTO ON_ERROR
+)
+
+SET LLVM_SRC_PATH=%TOP%
+SET LLVM_BUILD_PATH=%TOP%\llvm-build
+
+REM Update to reflect value used in mono.props, MONO_LLVM_INSTALL_DIR_PREFIX property.
+SET LLVM_INSTALL_PATH=%~dp0dist\llvm
+
+SET CROSS_CMAKE_FLAGS=^
+-DCMAKE_INSTALL_PREFIX="%LLVM_INSTALL_PATH%" ^
+-DCMAKE_BUILD_TYPE=Release ^
+-DLLVM_ENABLE_ZLIB=OFF ^
+-DLLVM_TARGETS_TO_BUILD="X86" ^
+-DCMAKE_CROSSCOMPILING=False ^
+-DCMAKE_SYSTEM_NAME=Windows
+
+SET TEMP_WD=%CD%
+cd %LLVM_BUILD_PATH%
+ECHO cmake.exe -G "Visual Studio 14 2015 Win64" %CROSS_CMAKE_FLAGS% %LLVM_SRC_PATH%
+cmake.exe -G "Visual Studio 14 2015 Win64" %CROSS_CMAKE_FLAGS% %LLVM_SRC_PATH%
+cd %TEMP_WD%
+
+:ON_ERROR
+ SET CONFIG_RESULT=ERRORLEVEL + GOTO ON_EXIT
+
+:ON_EXIT
+ SET PATH=%TEMP_PATH%
+ EXIT /b %CONFIG_RESULT%
+
+@ECHO ON
\ No newline at end of file diff --git a/msvc/mono.props b/msvc/mono.props index c9bd97e59e9..4c93b8dc47b 100644 --- a/msvc/mono.props +++ b/msvc/mono.props @@ -5,6 +5,8 @@ <MONO_BUILD_DIR_PREFIX>$(MSBuildProjectDirectory)/./build/</MONO_BUILD_DIR_PREFIX> <!-- Change this to custom distribution tree location to enable out of source tree distribution, example c:/mono-dist/ --> <MONO_INSTALL_DIR_PREFIX>$(MSBuildProjectDirectory)/./dist/</MONO_INSTALL_DIR_PREFIX> + <!-- Change this to custom install tree location to enable out of source tree builds, example c:/mono-llvm/ --> + <MONO_LLVM_INSTALL_DIR_PREFIX>$(MONO_INSTALL_DIR_PREFIX)llvm/</MONO_LLVM_INSTALL_DIR_PREFIX> <!-- GC in use, sgen or boehm, default is sgen. --> <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. --> @@ -15,6 +17,8 @@ <MONO_USE_STATIC_C_RUNTIME>false</MONO_USE_STATIC_C_RUNTIME> <!-- When true, mono binaries will link using static libmono. When false, mono binaries will link using dynamic libmono. --> <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> </PropertyGroup> <PropertyGroup Label="MonoDirectories"> <MonoSourceLocation Condition="'$(MonoSourceLocation)' == '' ">..</MonoSourceLocation> @@ -30,6 +34,11 @@ <LIBGC_CPPFLAGS_INCLUDE>$(MONO_LIBGC_INCLUDE_DIR)</LIBGC_CPPFLAGS_INCLUDE> <GLIB_CFLAGS_INCLUDE>$(MONO_EGLIB_SOURCE_DIR)</GLIB_CFLAGS_INCLUDE> </PropertyGroup> + <PropertyGroup Label="MonoLLVMDirectories"> + <MONO_LLVM_INCLUDE_DIR>$(MONO_LLVM_INSTALL_DIR_PREFIX)include</MONO_LLVM_INCLUDE_DIR> + <MONO_LLVM_LIB_DIR>$(MONO_LLVM_INSTALL_DIR_PREFIX)lib</MONO_LLVM_LIB_DIR> + <MONO_LLVM_BIN_DIR>$(MONO_LLVM_INSTALL_DIR_PREFIX)bin</MONO_LLVM_BIN_DIR> + </PropertyGroup> <PropertyGroup Label="Static-C-Runtime" Condition="$(MONO_USE_STATIC_C_RUNTIME)=='true'"> <MONO_C_RUNTIME Condition="'$(Configuration)'=='Debug'">MultiThreadedDebug</MONO_C_RUNTIME> <MONO_C_RUNTIME Condition="'$(Configuration)'!='Debug'">MultiThreaded</MONO_C_RUNTIME> @@ -66,6 +75,12 @@ <PropertyGroup Label="MonoProfiler"> <VTUNE_INCLUDE_DIR>$(ProgramFiles)/Intel/VTune Amplifier XE 2013/include</VTUNE_INCLUDE_DIR> </PropertyGroup> + <PropertyGroup Label="MONO_ENABLE_LLVM" Condition="$(MONO_ENABLE_LLVM)=='true'"> + <MONO_LLVM_CODEGEN_LIBS>LLVMX86CodeGen.lib;LLVMX86Desc.lib;LLVMX86Info.lib;LLVMObject.lib;LLVMBitReader.lib;LLVMMCDisassembler.lib;LLVMX86AsmPrinter.lib;LLVMX86Utils.lib;LLVMSelectionDAG.lib;LLVMAsmPrinter.lib;LLVMMCParser.lib;LLVMCodeGen.lib;LLVMScalarOpts.lib;LLVMInstCombine.lib;LLVMTransformUtils.lib;LLVMipa.lib</MONO_LLVM_CODEGEN_LIBS> + <MONO_LLVM_JIT_LIBS>LLVMMCJIT.lib;LLVMRuntimeDyld.lib;LLVMObject.lib;LLVMMCParser.lib;LLVMBitReader.lib;LLVMJIT.lib;LLVMExecutionEngine.lib;LLVMCodeGen.lib;LLVMScalarOpts.lib;LLVMInstCombine.lib;LLVMTransformUtils.lib</MONO_LLVM_JIT_LIBS> + <MONO_LLVM_LIBS>$(MONO_LLVM_CODEGEN_LIBS);$(MONO_LLVM_JIT_LIBS);LLVMBitWriter.lib;LLVMAnalysis.lib;LLVMTarget.lib;LLVMMC.lib;LLVMCore.lib;LLVMSupport.lib</MONO_LLVM_LIBS> + <MONO_ADDITIONAL_PREPROCESSOR_DEFINITIONS>ENABLE_LLVM=1;$(MONO_ADDITIONAL_PREPROCESSOR_DEFINITIONS)</MONO_ADDITIONAL_PREPROCESSOR_DEFINITIONS> + </PropertyGroup> <ItemGroup> <BuildMacro Include="MONO_BUILD_DIR_PREFIX"> <Value>$(MONO_BUILD_DIR_PREFIX)</Value> @@ -73,6 +88,9 @@ <BuildMacro Include="MONO_INSTALL_DIR_PREFIX"> <Value>$(MONO_INSTALL_DIR_PREFIX)</Value> </BuildMacro> + <BuildMacro Include="MONO_LLVM_INSTALL_DIR_PREFIX"> + <Value>$(MONO_LLVM_INSTALL_DIR_PREFIX)</Value> + </BuildMacro> <BuildMacro Include="MONO_TARGET_GC"> <Value>$(MONO_TARGET_GC)</Value> </BuildMacro> @@ -88,12 +106,18 @@ <BuildMacro Include="MONO_USE_STATIC_LIBMONO"> <Value>$(MONO_USE_STATIC_LIBMONO)</Value> </BuildMacro> + <BuildMacro Include="MONO_ENABLE_LLVM"> + <Value>$(MONO_ENABLE_LLVM)</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=0x0600;_WIN32_WINNT=0x0600;_WIN32_IE=0x0501;_UNICODE;UNICODE;FD_SETSIZE=1024;NVALGRIND;$(MONO_ADDITIONAL_PREPROCESSOR_DEFINITIONS)</MONO_PREPROCESSOR_DEFINITIONS> + </PropertyGroup> <ItemDefinitionGroup> <ClCompile> <DllExportPreprocessorDefinitions>MONO_DLL_EXPORT</DllExportPreprocessorDefinitions> <DllImportPreprocessorDefinitions>MONO_DLL_IMPORT</DllImportPreprocessorDefinitions> - <PreprocessorDefinitions>__default_codegen__;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;GC_NOT_DLL;WIN32_THREADS;WINVER=0x0600;_WIN32_WINNT=0x0600;_WIN32_IE=0x0501;_UNICODE;UNICODE;FD_SETSIZE=1024;NVALGRIND;%(PreprocessorDefinitions);</PreprocessorDefinitions> + <PreprocessorDefinitions>$(MONO_PREPROCESSOR_DEFINITIONS);%(PreprocessorDefinitions)</PreprocessorDefinitions> <DisableSpecificWarnings>4273;4005;4152;4221;4214;4204;4201</DisableSpecificWarnings> <RuntimeLibrary>$(MONO_C_RUNTIME)</RuntimeLibrary> </ClCompile> diff --git a/msvc/mono.vcxproj b/msvc/mono.vcxproj index 0c3eba152b2..7567c5e3b98 100644 --- a/msvc/mono.vcxproj +++ b/msvc/mono.vcxproj @@ -103,8 +103,8 @@ </ClCompile>
<ProjectReference />
<Link>
- <AdditionalDependencies>$(MONO_LIBMONO_LIB);%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>$(MONO_LIBMONO_LIB);$(MONO_LLVM_LIBS);%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(MONO_LLVM_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
@@ -131,8 +131,8 @@ <LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Link>
- <AdditionalDependencies>$(MONO_LIBMONO_LIB);%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>$(MONO_LIBMONO_LIB);$(MONO_LLVM_LIBS);%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(MONO_LLVM_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<ShowProgress>
</ShowProgress>
@@ -152,8 +152,8 @@ <LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Link>
- <AdditionalDependencies>$(MONO_LIBMONO_LIB);%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>$(MONO_LIBMONO_LIB);$(MONO_LLVM_LIBS);%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(MONO_LLVM_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
@@ -176,8 +176,8 @@ <LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<Link>
- <AdditionalDependencies>$(MONO_LIBMONO_LIB);%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>$(MONO_LIBMONO_LIB);$(MONO_LLVM_LIBS);%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(MONO_LLVM_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
|