Initialize the MSP430 AsmParser if available

This commit is contained in:
Nikita Popov 2019-07-23 22:00:25 +02:00
parent 3ebca72a11
commit 71717b951a
2 changed files with 6 additions and 0 deletions

View File

@ -119,6 +119,10 @@ fn main() {
println!("cargo:rustc-cfg=llvm_component=\"{}\"", component);
}
if major >= 9 {
println!("cargo:rustc-cfg=llvm_has_msp430_asm_parser");
}
// Link in our own LLVM shims, compiled with the same flags as LLVM
let mut cmd = Command::new(&llvm_config);
cmd.arg("--cxxflags");

View File

@ -76,6 +76,8 @@ pub fn initialize_available_targets() {
LLVMInitializeMSP430Target,
LLVMInitializeMSP430TargetMC,
LLVMInitializeMSP430AsmPrinter);
init_target!(all(llvm_component = "msp430", llvm_has_msp430_asm_parser),
LLVMInitializeMSP430AsmParser);
init_target!(llvm_component = "riscv",
LLVMInitializeRISCVTargetInfo,
LLVMInitializeRISCVTarget,