my $config = SPVM::Builder::Config::Exe->new;

$config->add_lib_dir('../..');

$config->add_lib('m');

$config->global->build_type('Debug');

$config->global->add_before_link_cb(sub {
  my ($link_info) = @_;
  
  unless ($link_info->config) {
    die;
  }
  
  $main::MYAPP_LINK_INFO_AFTER_PREPARE_LINK_CB = $link_info;
});

$config->global->add_after_link_cb(sub {
  my ($link_info) = @_;
  
  unless ($link_info->config) {
    die;
  }
  
  $main::MYAPP_LINK_INFO_AFTER_LINK_CB = $link_info;
});

$config->global->add_before_compile_cb(sub {
  my ($compile_info) = @_;
  
  unless ($compile_info->config) {
    die;
  }
  
  $main::MYAPP_COMPILE_INFO_AFTER_PREPARE_COMPILE_CB ||= $compile_info;
});

$ENV{SPVM__TEST__MYAPP__EXE} = 1;

$config->use_resource('TestCase::Resource::Mylib1');
$config->use_resource('TestCase::Resource::Mylib2');

if (@ARGV) {
  warn "[Test Output]\@ARGV : @ARGV";
}

$config;
