-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (31 loc) · 995 Bytes
/
Copy pathmain.cpp
File metadata and controls
35 lines (31 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "daScript/daScript.h"
#include "daScript/misc/platform.h"
using namespace das;
extern int MAIN_FUNC_NAME ( int, char * argv[] );
namespace das { DAS_IMPORT_DLL vector<void *> force_aot_stub(); }
int main(int argc, char * argv[]) {
// force libDaScriptAot linking
force_aot_stub();
// request our custom module
NEED_MODULE(Module_BuiltIn);
NEED_MODULE(Module_TestProfile);
// call daslang for main.das
string dasRoot = getDasRoot() + "/examples/profile/main.das";
vector<const char *> newArgv;
newArgv.push_back(argv[0]);
newArgv.push_back(dasRoot.c_str());
bool noJIT = false;
for ( int i=1; i<argc; ++i ) {
if ( strcmp(argv[i],"-html")==0 ) {
noJIT = true;
}
}
if ( !noJIT ) {
newArgv.push_back("-jit");
newArgv.push_back("--");
}
for ( int i=1; i<argc; ++i ) {
newArgv.push_back(argv[i]);
}
return MAIN_FUNC_NAME(newArgv.size(),(char **)newArgv.data());
}