Make stdlib

* Build the standard library as a module .so
 * Locate and load lib at runtime as a module
   if it is not provided to the ChaiScript
   constructor.

Decreases compile time by 1/2 for common use cases
where the user can use the dynamic library module.
This commit is contained in:
Jason Turner
2012-06-03 08:11:37 -06:00
parent a3e299fe1b
commit 4ebfe264e9
6 changed files with 85 additions and 9 deletions

View File

@@ -10,7 +10,6 @@
#define _CRT_SECURE_NO_WARNINGS
#include <chaiscript/chaiscript.hpp>
#include <chaiscript/chaiscript_stdlib.hpp>
#ifdef READLINE_AVAILABLE
#include <readline/readline.h>
@@ -177,7 +176,7 @@ int main(int argc, char *argv[])
modulepaths.push_back(modulepath);
}
chaiscript::ChaiScript chai(chaiscript::Std_Lib::library(), modulepaths,usepaths);
chaiscript::ChaiScript chai(modulepaths,usepaths);
chai.add(chaiscript::fun(&myexit), "exit");
chai.add(chaiscript::fun(&myexit), "quit");