Skip to content

Commit

Permalink
Add a library that can compile very simple C libraries for usage duri…
Browse files Browse the repository at this point in the history
…ng testing.
  • Loading branch information
jnthn committed Jan 13, 2012
1 parent bcbdb85 commit 9ce75d1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions t/CompileTestLib.pm
@@ -0,0 +1,11 @@
module t::CompileTestLib;

sub compile_test_lib($name) is export {
my $o = $*VM<config><o>;
my $so = $*VM<config><load_ext>;
my $c_line = "$*VM<config><cc> -c $*VM<config><cc_o_out>$name$o $*VM<config><ccflags> t/$name.c";
my $l_line = "$*VM<config><ld> $*VM<config><ldflags> $*VM<config><ld_load_flags> " ~
"$*VM<config><libs> $*VM<config><ld_out>$name$so $name$o";
shell($c_line);
shell($l_line);
}

0 comments on commit 9ce75d1

Please sign in to comment.