mirror of
git://git.proxmox.com/git/perlmod.git
synced 2025-03-13 04:58:16 +03:00
guard '-L./target/debug' lib path by debug_assertions
A release build shouldn't add the local search path for libraries to the perl modules. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
81e9f75763
commit
241e69eed8
@ -39,7 +39,15 @@ BEGIN {
|
|||||||
my ($mod_name) = {{LIB_NAME}};
|
my ($mod_name) = {{LIB_NAME}};
|
||||||
|
|
||||||
my @dirs = (map "-L$_/auto/$auto_path", @INC);
|
my @dirs = (map "-L$_/auto/$auto_path", @INC);
|
||||||
my (@mod_files) = DynaLoader::dl_findfile(@dirs, '-L./target/debug', $mod_name);
|
my (@mod_files) = DynaLoader::dl_findfile(@dirs"#;
|
||||||
|
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
const MODULE_HEAD_DEBUG: &str = r#", '-L./target/debug'"#;
|
||||||
|
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
const MODULE_HEAD_DEBUG: &str = "";
|
||||||
|
|
||||||
|
const MODULE_HEAD_2: &str = r#", $mod_name);
|
||||||
die "failed to locate shared library for '$pkg' (lib${mod_name}.so)\n" if !@mod_files;
|
die "failed to locate shared library for '$pkg' (lib${mod_name}.so)\n" if !@mod_files;
|
||||||
|
|
||||||
$LIB = DynaLoader::dl_load_file($mod_files[0])
|
$LIB = DynaLoader::dl_load_file($mod_files[0])
|
||||||
@ -87,7 +95,10 @@ impl Package {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn write(&self) -> Result<(), Error> {
|
pub fn write(&self) -> Result<(), Error> {
|
||||||
let mut source = format!("package {};\n{}", self.attrs.package_name, MODULE_HEAD);
|
let mut source = format!(
|
||||||
|
"package {};\n{}{}{}",
|
||||||
|
self.attrs.package_name, MODULE_HEAD, MODULE_HEAD_DEBUG, MODULE_HEAD_2
|
||||||
|
);
|
||||||
|
|
||||||
for export in &self.exported {
|
for export in &self.exported {
|
||||||
source = format!(
|
source = format!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user