Skip to content

Commit

Permalink
Switch building to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrtj committed Sep 19, 2024
1 parent 93379d2 commit 36eb805
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
19 changes: 14 additions & 5 deletions alienfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,27 @@ share {
);
plugin Extract => 'tar.gz';

requires 'Alien::Autotools'; # needed for autoreconf (in autogen.sh)
plugin 'Build::Autoconf';
plugin 'Build::CMake';
plugin 'Gather::IsolateDynamic';
build [
'sh autogen.sh',
'%{configure} --enable-module-schnorrsig',
[
'%{cmake}',
@{meta->prop->{plugin_build_cmake}->{args}},
'-DSECP256K1_DISABLE_SHARED=ON',
'-DSECP256K1_VALGRIND=OFF',
'-DSECP256K1_BUILD_TESTS=' . ($run_tests ? 'ON' : 'OFF'),
'-DSECP256K1_BUILD_EXHAUSTIVE_TESTS=OFF',
'-DSECP256K1_BUILD_CTIME_TESTS=OFF',
'-DSECP256K1_BUILD_BENCHMARK=OFF',
'-DCMAKE_BUILD_TYPE=Release',
'%{.install.extract}'
],
'%{make}',
'%{make} install',
];

test [
'%{make} check',
'%{make} test',
] if $run_tests;
};

Expand Down
2 changes: 1 addition & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ on 'test' => sub {
requires 'Test2::V0' => '0';
};

requires 'Alien::Autotools' => '0';
requires 'Alien::cmake3' => '0';

7 changes: 5 additions & 2 deletions t/base.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Alien::libsecp256k1;
alien_ok 'Alien::libsecp256k1';

xs_ok do { local $/; <DATA> }, with_subtest {
Secp256k1Test::secp256k1_selftest();
Secp256k1Test::do_selftest();
pass; # selftest should abort the program if it fails
};

Expand All @@ -24,5 +24,8 @@ __DATA__
MODULE = Secp256k1Test PACKAGE = Secp256k1Test
void secp256k1_selftest()
void
do_selftest()
CODE:
secp256k1_selftest();

0 comments on commit 36eb805

Please sign in to comment.