)\r
\r
:: Make sure boringssl submodule is up to date.\r
+echo Updating submodule "%BTLS_DIR%"
"%GIT%" submodule update --init -- "%BTLS_DIR%"\r
if not ERRORLEVEL == 0 (\r
"%GIT%" submodule init -- "%BTLS_DIR%"\r
)\r
\r
:: Make sure llvm submodule is up to date.\r
+echo Updating submodule "%LLVM_DIR%"
"%GIT%" submodule update --init -- "%LLVM_DIR%"\r
if not ERRORLEVEL == 0 (\r
"%GIT%" submodule init -- "%LLVM_DIR%"\r
set CMAKE_GENERATOR_ARCH=-A %CMAKE_GENERATOR_ARCH%\r
)\r
\r
+:: 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.\r
"%CMAKE%" ^\r
-DCMAKE_INSTALL_PREFIX="%LLVM_INSTALL_DIR%" ^\r
%CMAKE_GENERATOR_ARGS% ^\r
-G "%CMAKE_GENERATOR%" ^\r
%CMAKE_GENERATOR_ARCH% ^\r
-"%LLVM_DIR%"\r
+"%LLVM_SOURCE_DIR%"
\r
if not ERRORLEVEL == 0 (\r
goto ON_ERROR\r
<PropertyGroup>
<_LLVMSourceDir Condition="'$(_LLVMSourceDir)' == ''">$(MONO_INTERNAL_LLVM_SOURCE_DIR)</_LLVMSourceDir>
- <_LLVMSourceDir Condition="'$(_LLVMSourceDir)' == ''">$(_MonoSourceDir)\external\llvm-project\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>