Skip to content

Commit

Permalink
Build compiler-rt from the runtimes directory. (#6)
Browse files Browse the repository at this point in the history
* Build compiler-rt from the runtimes directory.

* Fix the runtimes build.
  • Loading branch information
cbuttner authored Jul 16, 2024
1 parent 523090d commit 326c970
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
runs-on: windows-latest
env:
LLVM_VERSION: 18.1.8
LLVM_MAJOR_VERSION: 18

strategy:
fail-fast: false
Expand Down
14 changes: 10 additions & 4 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ cd %WORKING_DIR%

set THIS_DIR=%CD%

cd llvm-project

mkdir llvm\build
cd llvm\build
mkdir llvm-project\llvm\build
cd llvm-project\llvm\build
cmake .. %LLVM_CMAKE_CONFIGURE_FLAGS%
cmake --build . %CMAKE_BUILD_FLAGS%
cmake --build . --target install %CMAKE_BUILD_FLAGS%

cd %THIS_DIR%

mkdir llvm-project\runtimes\build
cd llvm-project\runtimes\build
cmake .. %RUNTIMES_CMAKE_CONFIGURE_FLAGS%
cmake --build . %CMAKE_BUILD_FLAGS%
cmake --build . --target install %CMAKE_BUILD_FLAGS%

cd %THIS_DIR%

7z a -t7z %GITHUB_WORKSPACE%\%LLVM_RELEASE_FILE% %LLVM_RELEASE_NAME%
25 changes: 19 additions & 6 deletions set-env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ goto :loop
set CONFIGURATION=Release
set DEBUG_SUFFIX=
set LLVM_CMAKE_CONFIGURE_EXTRA_FLAGS=
set RUNTIME_CMAKE_CONFIGURE_EXTRA_FLAGS=
set CLANG_CMAKE_CONFIGURE_EXTRA_FLAGS=
shift
goto :loop
Expand All @@ -127,6 +128,7 @@ goto :loop
set CONFIGURATION=Debug
set DEBUG_SUFFIX=-dbg
set LLVM_CMAKE_CONFIGURE_EXTRA_FLAGS=-DLLVM_BUILD_TOOLS=OFF -DLLVM_ENABLE_ASSERTIONS=ON
set RUNTIME_CMAKE_CONFIGURE_EXTRA_FLAGS=
set CLANG_CMAKE_CONFIGURE_EXTRA_FLAGS=-DCLANG_BUILD_TOOLS=OFF
shift
goto :loop
Expand Down Expand Up @@ -165,17 +167,29 @@ set LLVM_CMAKE_CONFIGURE_FLAGS= ^
-DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=TRUE ^
-DCMAKE_MSVC_RUNTIME_LIBRARY=%CMAKE_CRT% ^
-DCMAKE_MT=mt ^
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON ^
-DLLVM_ENABLE_TERMINFO=OFF ^
-DLLVM_ENABLE_ZLIB=OFF ^
-DLLVM_INCLUDE_BENCHMARKS=OFF ^
-DLLVM_INCLUDE_DOCS=OFF ^
-DLLVM_ENABLE_PROJECTS=clang;lld ^
-DLLVM_ENABLE_PROJECTS=lld ^
-DLLVM_INCLUDE_EXAMPLES=OFF ^
-DLLVM_INCLUDE_GO_TESTS=OFF ^
-DLLVM_INCLUDE_RUNTIMES=OFF ^
-DLLVM_INCLUDE_TESTS=OFF ^
-DLLVM_INCLUDE_UTILS=OFF ^
%LLVM_CMAKE_CONFIGURE_EXTRA_FLAGS%

set RUNTIMES_CMAKE_CONFIGURE_FLAGS= ^
-G "%CMAKE_GENERATOR%%CMAKE_GENERATOR_SUFFIX%" ^
-Thost=x64 ^
-DCMAKE_INSTALL_PREFIX=%LLVM_RELEASE_DIR%/lib/clang/%LLVM_MAJOR_VERSION% ^
-DCMAKE_MSVC_RUNTIME_LIBRARY=%CMAKE_CRT% ^
-DCMAKE_MT=mt ^
-DCMAKE_C_COMPILER_TARGET="x86_64-pc-windows-msvc" ^
-DLLVM_ENABLE_RUNTIMES=compiler-rt ^
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON ^
-DCOMPILER_RT_BUILD_BUILTINS=OFF ^
%RUNTIME_CMAKE_CONFIGURE_EXTRA_FLAGS%

set CMAKE_BUILD_FLAGS= ^
--config %CONFIGURATION% ^
-- ^
Expand All @@ -188,15 +202,14 @@ set DEPLOY_FILE=%LLVM_RELEASE_FILE%

echo ---------------------------------------------------------------------------
echo LLVM_VERSION: %LLVM_VERSION%
echo LLVM_MAJOR_VERSION: %LLVM_MAJOR_VERSION%
echo LLVM_MASTER_URL: %LLVM_MASTER_URL%
echo LLVM_DOWNLOAD_URL: %LLVM_DOWNLOAD_URL%
echo LLVM_RELEASE_FILE: %LLVM_RELEASE_FILE%
echo LLVM_RELEASE_URL: %LLVM_RELEASE_URL%
echo LLVM_CMAKE_CONFIGURE_FLAGS: %LLVM_CMAKE_CONFIGURE_FLAGS%
echo ---------------------------------------------------------------------------
echo CLANG_DOWNLOAD_URL: %CLANG_DOWNLOAD_URL%
echo CLANG_RELEASE_FILE: %CLANG_RELEASE_FILE%
echo CLANG_CMAKE_CONFIGURE_FLAGS: %CLANG_CMAKE_CONFIGURE_FLAGS%
echo RUNTIMES_CMAKE_CONFIGURE_FLAGS: %RUNTIMES_CMAKE_CONFIGURE_FLAGS%
echo ---------------------------------------------------------------------------
echo DEPLOY_FILE: %DEPLOY_FILE%
echo ---------------------------------------------------------------------------

0 comments on commit 326c970

Please sign in to comment.