How to add target infomation after finishing building the llvm project?

Two weeks ago, I build the llvm project in my computer and I only add x86 target information to it.

Now, I want to compile llvm IR to assembly code of riscv32.

Are there any way to add target info to clang or opt or others tool after finishing building the llvm project?

I already googled this issue but there is nothing mention about this.

All I know is that I can re-build llvm project, but it consume too much time for me.

I think there is no other way to add riscv32 information to my builded llvm, but I just want to ask and confirm it.

You can just rerun the cmake with

cmake -DLLVM_TARGETS_TO_BUILD="X86;RISCV"

and then ninja all. It will rebuild only the part that needed to be rebuild.

That’s works!
Thank you very much!