Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: compiled libraries have munlib extension instead of dll/so #75

Merged
merged 1 commit into from
Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions crates/mun_compiler/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::{
};
use mun_codegen::IrDatabase;
use mun_hir::{FileId, RelativePathBuf, SourceDatabase, SourceRoot, SourceRootId};
use mun_target::spec::Target;
use std::{
path::{Path, PathBuf},
sync::Arc,
Expand Down Expand Up @@ -126,19 +125,11 @@ impl Driver {
impl Driver {
/// Computes the output path for the assembly of the specified file.
fn assembly_output_path(&self, file_id: FileId) -> PathBuf {
let target: Target = self.db.target();
let relative_path: RelativePathBuf = self.db.file_relative_path(file_id);
let original_filename = Path::new(relative_path.file_name().unwrap());

// Get the dll suffix without the starting dot
let dll_extension = if target.options.dll_suffix.starts_with('.') {
&target.options.dll_suffix[1..]
} else {
&target.options.dll_suffix
};

// Add the dll suffix to the original filename
let output_file_name = original_filename.with_extension(dll_extension);
// Add the `munlib` suffix to the original filename
let output_file_name = original_filename.with_extension("munlib");

// If there is an out dir specified, prepend the output directory
if let Some(ref out_dir) = self.out_dir {
Expand Down
4 changes: 0 additions & 4 deletions crates/mun_target/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ pub struct TargetOptions {
/// String to prepend to the name of every dynamic library. Defaults to "lib".
pub dll_prefix: String,

/// String to append to the name of every dynamic library. Defaults to ".so".
pub dll_suffix: String,

/// Whether the target toolchain is like Windows
pub is_like_windows: bool,
}
Expand All @@ -66,7 +63,6 @@ impl Default for TargetOptions {
cpu: "generic".to_string(),
features: "".to_string(),
dll_prefix: "lib".to_string(),
dll_suffix: ".so".to_string(),
is_like_windows: false,
}
}
Expand Down
1 change: 0 additions & 1 deletion crates/mun_target/src/spec/apple_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::env;
pub fn opts() -> TargetOptions {
TargetOptions {
dll_prefix: "lib".to_string(),
dll_suffix: ".dylib".to_string(),
..Default::default()
}
}
Expand Down
1 change: 0 additions & 1 deletion crates/mun_target/src/spec/windows_msvc_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::spec::TargetOptions;
pub fn opts() -> TargetOptions {
TargetOptions {
dll_prefix: "".to_string(),
dll_suffix: ".dll".to_string(),
is_like_windows: true,
..Default::default()
}
Expand Down