3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-23 12:29:27 +01:00

Add C++ language to compiler_vm

This commit is contained in:
Pragmatic Software 2015-04-05 02:30:42 -07:00
parent 14ebbe2533
commit 8686a40104
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,41 @@
#!/usr/bin/perl
use warnings;
use strict;
package cpp;
use parent '_c_base';
sub initialize {
my ($self, %conf) = @_;
$self->{name} = 'c++';
$self->{sourcefile} = 'prog.cpp';
$self->{execfile} = 'prog';
$self->{default_options} = '-std=c++11 -Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -Wshadow -lm -Wfatal-errors';
$self->{options_paste} = '-fdiagnostics-show-caret';
$self->{options_nopaste} = '-fno-diagnostics-show-caret';
$self->{cmdline} = 'g++ -ggdb -g3 $sourcefile $options -o $execfile';
$self->{prelude} = <<'END';
#define _XOPEN_SOURCE 9001
#define __USE_XOPEN
#include <iostream>
#include <limits>
#include <vector>
#include <exception>
#include <stdexcept>
#include <typeinfo>
#include <type_traits>
#include <typeindex>
#include <cstdlib>
#include <cstdio>
#include <cstdarg>
#include <functional>
#include <tuple>
#include <prelude.h>
END
}
1;

View File

@ -0,0 +1,9 @@
#!/usr/bin/perl
use warnings;
use strict;
package cpp;
use parent '_c_base';
1;