Previously out-of-tree passes could detect if LLVM was built with LLVM_BUILD_32_BITS by looking for -m32 in LLVM_DEFINITIONS, but as of r271871 it no longer appears there. Resolve this by instead emitting LLVM_BUILD_32_BITS in LLVMConfig so it can be checked for directly.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I don't like this idea that exposes LLVM_BUILD_32_BITS. Didn't you inspect LLVM_C*_FLAGS?
Or, we could introduce the way to export options for code formats, for other targets.
I supposed LLVM_BUILD_32_BITS as an option for developers.
LLVM_C*_FLAGS don't exist in LLVMConfig.cmake. I see LLVM_BUILD_32_BITS as similar in a way to LLVM_ENABLE_EH and LLVM_ENABLE_RTTI - it's something where out-of-tree plugins need to be aware of how LLVM was built otherwise LLVM will give an error when trying to load the plugin, so it needs to be exposed somehow.
This change is the best way to accomplish what needs to be done here for platforms that don't utilize fat binaries.
@chapuni, this option is only exposed to people using our shipped CMake modules, and they do need a way to know whether the modules they are importing are built for 32 or 64 bit targets.