Skip to content

Commit

Permalink
Merge pull request mono/mono#17749 from directhex/dotnet-llvm-monorepo
Browse files Browse the repository at this point in the history
[LLVM] Change llvm submodule to dotnet-org fork of official LLVM git repo

Commit migrated from mono/mono@3948a06
  • Loading branch information
Jo Shields authored Nov 8, 2019
2 parents 150bd36 + 4da174e commit 07b9387
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/mono/msvc/build-external-btls.bat
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ if "%GIT%" == "" (
)

:: Make sure boringssl submodule is up to date.
echo Updating submodule "%BTLS_DIR%"
"%GIT%" submodule update --init -- "%BTLS_DIR%"
if not ERRORLEVEL == 0 (
"%GIT%" submodule init -- "%BTLS_DIR%"
Expand Down
10 changes: 9 additions & 1 deletion src/mono/msvc/build-external-llvm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ if "%GIT%" == "" (
)

:: Make sure llvm submodule is up to date.
echo Updating submodule "%LLVM_DIR%"
"%GIT%" submodule update --init -- "%LLVM_DIR%"
if not ERRORLEVEL == 0 (
"%GIT%" submodule init -- "%LLVM_DIR%"
Expand Down Expand Up @@ -276,6 +277,13 @@ if not "%CMAKE_GENERATOR_ARCH%" == "" (
set CMAKE_GENERATOR_ARCH=-A %CMAKE_GENERATOR_ARCH%
)

:: Check if LLVM_DIR is just repro root or if we should build
:: a llvm subfolder within that repository.
set "LLVM_SOURCE_DIR=%LLVM_DIR%"
if exist "%LLVM_SOURCE_DIR%\llvm\CMakeLists.txt" (
set "LLVM_SOURCE_DIR=%LLVM_DIR%\llvm"
)

:: Run cmake.
"%CMAKE%" ^
-DCMAKE_INSTALL_PREFIX="%LLVM_INSTALL_DIR%" ^
Expand All @@ -293,7 +301,7 @@ if not "%CMAKE_GENERATOR_ARCH%" == "" (
%CMAKE_GENERATOR_ARGS% ^
-G "%CMAKE_GENERATOR%" ^
%CMAKE_GENERATOR_ARCH% ^
"%LLVM_DIR%"
"%LLVM_SOURCE_DIR%"

if not ERRORLEVEL == 0 (
goto ON_ERROR
Expand Down
4 changes: 2 additions & 2 deletions src/mono/msvc/mono.external.targets
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@

<PropertyGroup>
<_LLVMSourceDir Condition="'$(_LLVMSourceDir)' == ''">$(MONO_INTERNAL_LLVM_SOURCE_DIR)</_LLVMSourceDir>
<_LLVMSourceDir Condition="'$(_LLVMSourceDir)' == ''">$(_MonoSourceDir)\external\llvm</_LLVMSourceDir>
<_LLVMSourceDir Condition="'$(_LLVMSourceDir)' == ''">$(_MonoSourceDir)\external\llvm-project</_LLVMSourceDir>
<_LLVMBuildDir Condition="'$(_LLVMBuildDir)' == ''">$([System.IO.Path]::GetFullPath('$(MONO_BUILD_DIR_PREFIX)$(Platform)\obj\external\llvm-build\$(Configuration)'))</_LLVMBuildDir>
<_LLVMInstallDir Condition="'$(_LLVMInstallDir)' == ''">$(_LLVMBuildDir)\install</_LLVMInstallDir>
<_MonoLLVMConfig>$(_LLVMInstallDir)\bin\llvm-config.exe</_MonoLLVMConfig>
Expand Down Expand Up @@ -240,4 +240,4 @@
</PrepareForBuildDependsOn>
</PropertyGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions src/mono/msvc/mono.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<LIBGC_CPPFLAGS_INCLUDE>$(MONO_LIBGC_INCLUDE_DIR)</LIBGC_CPPFLAGS_INCLUDE>
<GLIB_CFLAGS_INCLUDE>$(MONO_EGLIB_SOURCE_DIR)</GLIB_CFLAGS_INCLUDE>
<MONO_LLVM_DEFAULT_API_VERSION>610</MONO_LLVM_DEFAULT_API_VERSION>
<MONO_LLVM_DEFAULT_INCLUDE_DIR>$(MONO_DIR)/external/llvm/include</MONO_LLVM_DEFAULT_INCLUDE_DIR>
<MONO_LLVM_DEFAULT_INCLUDE_DIR>$(MONO_DIR)/external/llvm-project/llvm/include</MONO_LLVM_DEFAULT_INCLUDE_DIR>
</PropertyGroup>
<PropertyGroup Label="Static-C-Runtime" Condition="$(MONO_USE_STATIC_C_RUNTIME)=='true'">
<MONO_C_RUNTIME Condition="'$(Configuration)'=='Debug'">MultiThreadedDebug</MONO_C_RUNTIME>
Expand Down Expand Up @@ -139,4 +139,4 @@
<AdditionalLibraryDirectories>$(MONO_BUILD_DIR_PREFIX)$(Platform)/lib/$(Configuration)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/mono/netcore/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ elif [[ "$configuration" == "Release" ]]; then
fi

if [ "$llvm" = "true" ]; then
git submodule update --init -- ../external/llvm || (Write-PipelineTelemetryError -c "git" -e 1 "Error fetching LLVM submodule" && exit 1)
git submodule update --init -- ../external/llvm-project || (Write-PipelineTelemetryError -c "git" -e 1 "Error fetching LLVM submodule" && exit 1)
autogen_params="$autogen_params --enable-llvm"
fi

Expand Down

0 comments on commit 07b9387

Please sign in to comment.