Skip to content

Commit

Permalink
Merge pull request #491 from codedownio/extra-setup-0.15.2
Browse files Browse the repository at this point in the history
Extra setup from cling.cpp
  • Loading branch information
JohanMabille committed Jul 21, 2023
2 parents c13e660 + 0019bfa commit cdaaadd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/xeus-cling/xinterpreter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ namespace xcpp
void restore_output();

void init_extra_includes();
void init_libs();
void init_preamble();
void init_magic();

Expand Down
10 changes: 10 additions & 0 deletions src/xinterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace xcpp
{
redirect_output();
init_extra_includes();
init_libs();
init_preamble();
init_magic();
}
Expand Down Expand Up @@ -434,6 +435,15 @@ namespace xcpp
m_interpreter.AddIncludePaths(XEUS_SEARCH_PATH);
}

void interpreter::init_libs()
{
const cling::InvocationOptions& Opts = m_interpreter.getOptions();
for (const std::string& Lib : Opts.LibsToLoad)
{
m_interpreter.loadFile(Lib);
}
}

void interpreter::init_preamble()
{
preamble_manager.register_preamble("introspection", new xintrospection(m_interpreter));
Expand Down

0 comments on commit cdaaadd

Please sign in to comment.