Alien-Xmake

 view release on metacpan or  search on metacpan

builder/Alien/Xmake/Builder.pm  view on Meta::CPAN

        }
        return 'github.com';
    }

    method _download_file ( $url, $dest ) {
        my $dest_str = "$dest";

        # Try HTTP::Tiny + IO::Socket::SSL
        if ( eval { require IO::Socket::SSL; 1 } ) {
            say 'Downloading with HTTP::Tiny...';
            my $http = HTTP::Tiny->new( verify_SSL => 1 );
            my $res  = $http->mirror( $url, $dest_str );
            if ( $res->{success} ) {
                return 1;
            }
            say "HTTP::Tiny failed: $res->{status} $res->{reason}";
        }
        else {
            say 'HTTP::Tiny skipped: IO::Socket::SSL not installed.';
        }

eg/xmake_demo.pl  view on Meta::CPAN

# -P .      : Create in current directory
# -l c      : Language C
# -t shared : Shared library
chdir $project_dir;
system( $xmake_bin, 'create', '-P', '.', '-l', 'c', '-t', 'shared', 'alien_lib' ) == 0 or die "Failed to create project";

# Build the project
say 'Building project...';
system($xmake_bin) == 0 or die "Build failed";

# Install to a local directory to verify artifacts
my $install_dir = $project_dir->child('dist');
say "Installing to $install_dir...";
system( $xmake_bin, 'install', '-o', $install_dir ) == 0 or die 'Install failed';

# Verify output
my $lib_dir = $install_dir->child('lib');
if ( $lib_dir->exists ) {
    $lib_dir->visit(
        sub {
            my ($path) = @_;



( run in 1.321 second using v1.01-cache-2.11-cpan-13bb782fe5a )