Skip to content

Commit

Permalink
Incorporate some fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Jul 4, 2024
1 parent f3a0eeb commit 9bb3bfd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
35 changes: 14 additions & 21 deletions install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,24 @@

if not exist %WORKING_DIR% mkdir %WORKING_DIR%

::..............................................................................

if /i "%BUILD_PROJECT%" == "llvm" goto :llvm
if /i "%BUILD_PROJECT%" == "clang" goto :clang

echo Invalid argument: '%1'
exit -1

::..............................................................................

:llvm

:: download LLVM sources

if /i "%BUILD_MASTER%" == "true" (
git clone --depth=1 %LLVM_MASTER_URL% %WORKING_DIR%\llvm-git
move %WORKING_DIR%\llvm-git\llvm %WORKING_DIR%
if exist %WORKING_DIR%\llvm-git\cmake move %WORKING_DIR%\llvm-git\cmake %WORKING_DIR%
) else (
powershell "Invoke-WebRequest -Uri %LLVM_DOWNLOAD_URL% -OutFile %WORKING_DIR%\%LLVM_DOWNLOAD_FILE%"
7z x -y %WORKING_DIR%\%LLVM_DOWNLOAD_FILE% -o%WORKING_DIR%
7z x -y %WORKING_DIR%\llvm-project-%LLVM_VERSION%.src.tar -o%WORKING_DIR%
move %WORKING_DIR%\llvm-project-%LLVM_VERSION%.src %WORKING_DIR%\llvm-project
dir %WORKING_DIR%
7z x -y %WORKING_DIR%\llvm-%LLVM_VERSION%.src.tar -o%WORKING_DIR%
ren %WORKING_DIR%\llvm-%LLVM_VERSION%.src llvm

if not "%LLVM_CMAKE_DOWNLOAD_URL%" == "" (
powershell "Invoke-WebRequest -Uri %LLVM_CMAKE_DOWNLOAD_URL% -OutFile %WORKING_DIR%\%LLVM_CMAKE_DOWNLOAD_FILE%"
7z x -y %WORKING_DIR%\%LLVM_CMAKE_DOWNLOAD_FILE% -o%WORKING_DIR%
7z x -y %WORKING_DIR%\cmake-%LLVM_VERSION%.src.tar -o%WORKING_DIR%
ren %WORKING_DIR%\cmake-%LLVM_VERSION%.src cmake
)
)

if "%CONFIGURATION%" == "Debug" goto dbg
Expand All @@ -38,11 +33,9 @@ goto :eof

:dbg

echo "Patch debug build"
echo set_target_properties(llvm-config PROPERTIES EXCLUDE_FROM_ALL FALSE) >> %WORKING_DIR%\llvm-project\llvm\tools\llvm-config\CMakeLists.txt
echo install(TARGETS llvm-config RUNTIME DESTINATION bin) >> %WORKING_DIR%\llvm-project\llvm\tools\llvm-config\CMakeLists.txt

perl pdb-patch.pl %WORKING_DIR%\llvm-project\llvm\cmake\modules\AddLLVM.cmake
echo set_target_properties(llvm-config PROPERTIES EXCLUDE_FROM_ALL FALSE) >> %WORKING_DIR%\llvm\tools\llvm-config\CMakeLists.txt
echo install(TARGETS llvm-config RUNTIME DESTINATION bin) >> %WORKING_DIR%\llvm\tools\llvm-config\CMakeLists.txt

goto :eof
perl pdb-patch.pl %WORKING_DIR%\llvm\cmake\modules\AddLLVM.cmake

::..............................................................................
3 changes: 2 additions & 1 deletion pdb-patch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
FILES ${pdb_dir}/${name}.pdb
CONFIGURATIONS Debug
DESTINATION lib${LLVM_LIBDIR_SUFFIX}
OPTIONAL
)
endif()
Expand All @@ -36,4 +37,4 @@
}

open (my $file, ">", $fileName) || die ("Can't open $fileName for writing: $!\n");
print $file (@body);
print $file (@body);
6 changes: 3 additions & 3 deletions set-env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ goto :loop
:libcmt
set CRT=libcmt
set LLVM_CRT=MT
set CMAKE_CRT=MultiThreaded
set CMAKE_CRT=MultiThreaded<$<CONFIG:Debug>:Debug>
shift
goto :loop

:msvcrt
set CRT=msvcrt
set LLVM_CRT=MD
set CMAKE_CRT=MultiThreadedDLL
set CMAKE_CRT=MultiThreaded<$<CONFIG:Debug>:Debug>DLL
shift
goto :loop

Expand All @@ -124,7 +124,7 @@ goto :loop
:dbg
set CONFIGURATION=Debug
set DEBUG_SUFFIX=-dbg
set LLVM_CMAKE_CONFIGURE_EXTRA_FLAGS=-DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_BUILD_TOOLS=ON -DLLVM_ENABLE_ASSERTIONS=ON
set LLVM_CMAKE_CONFIGURE_EXTRA_FLAGS=-DLLVM_BUILD_TOOLS=OFF -DLLVM_ENABLE_ASSERTIONS=ON
set CLANG_CMAKE_CONFIGURE_EXTRA_FLAGS=-DCLANG_BUILD_TOOLS=OFF
shift
goto :loop
Expand Down

0 comments on commit 9bb3bfd

Please sign in to comment.