How to pass Cmake options to the Runtimes configuration?

Previously to build LLVM with all the other projects included, I just passed -DLLVM_ENABLE_PROJECTS=‘clang;clang-tools-extra;lld;polly;…etc;’ to cmake with the rest of my options. Now its telling me to use ‘-DLLVM_ENABLE_RUNTIMES’ for libc++, Libc++abi,libunwind, openmp and compiler-rt, and the rest in ‘-DLLVM_ENABLE_PROJECTS’. So I now pass this:

cmake -B ‘build’ -S ‘llvm’ -GNinja
-DCLANG_DEFAULT_CXX_STDLIB=‘libc++’
-DCLANG_DEFAULT_LINKER=‘ld.lld’
-DCLANG_DEFAULT_OBJCOPY=‘llvm-objcopy’
-DCLANG_DEFAULT_OPENMP_RUNTIME=‘libomp’
-DCLANG_DEFAULT_PIE_ON_LINUX=‘on’
-DCLANG_DEFAULT_RTLIB=‘compiler-rt’
-DCLANG_DEFAULT_UNWINDLIB=‘libunwind’
-DCMAKE_INSTALL_PREFIX=‘/usr’
-DCMAKE_INSTALL_LIBEXECDIR=‘/usr/lib/clang’
-DCMAKE_BUILD_TYPE=‘Release’
-DLLVM_BUILD_LLVM_DYLIB=‘on’
-DLLVM_DEFAULT_TARGET_TRIPLE=“${CHOST}”
-DLLVM_ENABLE_FFI=‘on’
-DLLVM_ENABLE_LIBCXX=‘on’
-DLLVM_ENABLE_LLD=‘on’
-DLLVM_ENABLE_LTO=‘thin’
-DLLVM_ENABLE_RUNTIMES=‘libcxx;libcxxabi;openmp;libunwind;compiler-rt’
-DLLVM_ENABLE_PROJECTS=‘clang;clang-tools-extra;lld;polly;pstl;mlir;libclc’
-DLLVM_ENABLE_RTTI=‘on’
-DLLVM_ENABLE_SPHINX=‘on’
-DLLVM_INSTALL_BINUTILS_SYMLINKS=‘on’
-DLLVM_INSTALL_TOOLCHAIN_ONLY=‘true’
-DLLVM_INSTALL_UTILS=‘on’
-DLLVM_LINK_LLVM_DYLIB=‘on’
-DLLVM_PARALLEL_COMPILE_JOBS=‘12’
-DLLVM_PARALLEL_LINK_JOBS=‘12’
-DLLVM_USE_NEWPM=‘on’
-DPOLLY_BUNDLED_ISL=‘on’
-DPSTL_PARALLEL_BACKEND=‘omp’
-DLIBCXXABI_USE_COMPILER_RT=‘on’
-DLIBCXXABI_USE_LLVM_UNWINDER=‘on’
-DLIBCXX_USE_COMPILER_RT=‘on’
-DLIBUNWIND_INSTALL_HEADERS=‘on’
-DLIBUNWIND_USE_COMPILER_RT=‘on’
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=“${CHOST}”
ninja -C ‘build’

It builds the projects just fine with the options I gave to cmake but then when it is done compiling the projects, it then configures the runtimes and starts to compile them but will error very quickly due to my options not being passed to that invocation of cmake.

Is there a separate option for passing arguments to the runtimes build? Help?
Hope that all makes sense…

You can pass -DRUNTIMES_<target>_<cmake variable>=Linux

So for example:

-DRUNTIMES_x86_64-pc-linux-gnu_CMAKE_BUILD_TYPE=Release

Hope this helps.

Yes it did. Thank you!