File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,12 @@ can be any compiler supporting the same ABI.
9191In addition to the compiler, the build be able to find LLVM development tools
9292such as ` lit ` and ` FileCheck ` that are not found in an LLVM's install
9393directory. Use ` CMAKE_BINARY_DIR ` to point to directory where LLVM has
94- been built. A simple build configuration might look like the following:
94+ been built. When building Flang as part of a bootstrapping build
95+ (` LLVM_ENABLE_PROJECTS=flang ` ), Flang-RT has already been automatically added
96+ unless configured with ` -DFLANG_ENABLE_FLANG_RT=OFF ` . Add that option to avoid
97+ having two conflicting versions of the same library.
98+
99+ A simple build configuration might look like the following:
95100
96101``` bash
97102cmake -S < path-to-llvm-project-source> /runtimes \
Original file line number Diff line number Diff line change @@ -187,6 +187,19 @@ foreach(proj IN LISTS LLVM_ENABLE_RUNTIMES)
187187 endif ()
188188endforeach ()
189189
190+ option (FLANG_ENABLE_FLANG_RT "Implicitly add LLVM_ENABLE_RUNTIMES=flang-rt when compiling Flang" ON )
191+ if ("flang" IN_LIST LLVM_ENABLE_PROJECTS)
192+ if (NOT "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
193+ message (STATUS "Enabling Flang-RT as a dependency of Flang"
194+ "Flang-RT is required for a fully working Flang toolchain."
195+ "If you intend to compile Flang-RT separately following the instructions at"
196+ "https://github.com/llvm/llvm-project/blob/main/flang-rt/README.md#standalone-runtimes-build"
197+ "you should use -DFLANG_ENABLE_FLANG_RT=OFF to not build Flang-RT as part of this build."
198+ )
199+ list (APPEND LLVM_ENABLE_RUNTIMES "flang-rt" )
200+ endif ()
201+ endif ()
202+
190203# Set a shorthand option to enable the GPU build of the 'libc' project.
191204option (LIBC_GPU_BUILD "Enable the 'libc' project targeting the GPU" OFF )
192205if (LIBC_GPU_BUILD)
You can’t perform that action at this time.
0 commit comments