mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
ignore the absence of a Pkg-Config file
This commit is contained in:
parent
2abdbaae7d
commit
e516a0aebb
1 changed files with 24 additions and 12 deletions
|
@ -43,6 +43,9 @@ use std::time::{Duration, SystemTime};
|
||||||
/// Filename extension for normal Roc modules
|
/// Filename extension for normal Roc modules
|
||||||
const ROC_FILE_EXTENSION: &str = "roc";
|
const ROC_FILE_EXTENSION: &str = "roc";
|
||||||
|
|
||||||
|
/// Roc-Config file name
|
||||||
|
const ROC_CONFIG_FILE_NAME: &str = "Pkg-Config";
|
||||||
|
|
||||||
/// The . in between module names like Foo.Bar.Baz
|
/// The . in between module names like Foo.Bar.Baz
|
||||||
const MODULE_SEPARATOR: char = '.';
|
const MODULE_SEPARATOR: char = '.';
|
||||||
|
|
||||||
|
@ -1736,7 +1739,7 @@ fn load_pkg_config<'a>(
|
||||||
let mut filename = PathBuf::from(src_dir);
|
let mut filename = PathBuf::from(src_dir);
|
||||||
|
|
||||||
filename.push("platform");
|
filename.push("platform");
|
||||||
filename.push("Pkg-Config");
|
filename.push(ROC_CONFIG_FILE_NAME);
|
||||||
|
|
||||||
// End with .roc
|
// End with .roc
|
||||||
filename.set_extension(ROC_FILE_EXTENSION);
|
filename.set_extension(ROC_FILE_EXTENSION);
|
||||||
|
@ -1897,6 +1900,12 @@ fn parse_header<'a>(
|
||||||
module_timing,
|
module_timing,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let mut pkg_config_roc = pkg_config_dir.clone();
|
||||||
|
pkg_config_roc.push("platform");
|
||||||
|
pkg_config_roc.push(ROC_CONFIG_FILE_NAME);
|
||||||
|
pkg_config_roc.set_extension(ROC_FILE_EXTENSION);
|
||||||
|
|
||||||
|
if pkg_config_roc.as_path().exists() {
|
||||||
let load_pkg_config_msg = load_pkg_config(
|
let load_pkg_config_msg = load_pkg_config(
|
||||||
arena,
|
arena,
|
||||||
&pkg_config_dir,
|
&pkg_config_dir,
|
||||||
|
@ -1909,6 +1918,9 @@ fn parse_header<'a>(
|
||||||
module_id,
|
module_id,
|
||||||
Msg::Many(vec![app_module_header_msg, load_pkg_config_msg]),
|
Msg::Many(vec![app_module_header_msg, load_pkg_config_msg]),
|
||||||
))
|
))
|
||||||
|
} else {
|
||||||
|
Ok((module_id, app_module_header_msg))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok((ast::Module::Platform { header }, _parse_state)) => fabricate_effects_module(
|
Ok((ast::Module::Platform { header }, _parse_state)) => fabricate_effects_module(
|
||||||
arena,
|
arena,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue