Use LinkType::Executable for normal builds

This commit is contained in:
Richard Feldman 2020-10-25 01:15:05 -04:00
parent 14c8a00f9d
commit 9c49662a24
2 changed files with 4 additions and 3 deletions

View file

@ -24,6 +24,7 @@ pub fn build_file(
src_dir: PathBuf, src_dir: PathBuf,
roc_file_path: PathBuf, roc_file_path: PathBuf,
opt_level: OptLevel, opt_level: OptLevel,
link_type: LinkType,
) -> Result<PathBuf, LoadingProblem> { ) -> Result<PathBuf, LoadingProblem> {
let compilation_start = SystemTime::now(); let compilation_start = SystemTime::now();
let arena = Bump::new(); let arena = Bump::new();
@ -104,8 +105,7 @@ pub fn build_file(
target, target,
binary_path, binary_path,
&[host_input_path.as_path().to_str().unwrap(), app_o_file.as_path().to_str().unwrap()], &[host_input_path.as_path().to_str().unwrap(), app_o_file.as_path().to_str().unwrap()],
// LinkType::Executable, link_type
LinkType::Dylib,
) )
.map_err(|_| { .map_err(|_| {
todo!("gracefully handle `rustc` failing to spawn."); todo!("gracefully handle `rustc` failing to spawn.");

View file

@ -3,6 +3,7 @@ extern crate clap;
use clap::ArgMatches; use clap::ArgMatches;
use clap::{App, Arg}; use clap::{App, Arg};
use roc_build::link::LinkType;
use roc_gen::llvm::build::OptLevel; use roc_gen::llvm::build::OptLevel;
use std::io; use std::io;
use std::path::Path; use std::path::Path;
@ -91,7 +92,7 @@ pub fn build(target: &Triple, matches: &ArgMatches, run_after_build: bool) -> io
} }
}); });
let binary_path = build::build_file(target, src_dir, path, opt_level) let binary_path = build::build_file(target, src_dir, path, opt_level, LinkType::Executable)
.expect("TODO gracefully handle build_file failing"); .expect("TODO gracefully handle build_file failing");
if run_after_build { if run_after_build {