Skip to content

Commit 2a6dacc

Browse files
Enhance init_includes to handle dynamic include paths
1 parent f98cca3 commit 2a6dacc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/xinterpreter.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,25 @@ __get_cxx_version ()
357357

358358
void interpreter::init_includes()
359359
{
360+
// Add the standard include path
360361
Cpp::AddIncludePath((xeus::prefix_path() + "/include/").c_str());
362+
363+
// Add non-standard include paths from XEUS_SEARCH_PATH
364+
const char* non_standard_paths = XEUS_SEARCH_PATH;
365+
366+
if (non_standard_paths && std::strlen(non_standard_paths) > 0)
367+
{
368+
// Split the paths by colon ':' and add each one
369+
std::istringstream stream(non_standard_paths);
370+
std::string path;
371+
while (std::getline(stream, path, ':'))
372+
{
373+
if (!path.empty())
374+
{
375+
Cpp::AddIncludePath(path.c_str());
376+
}
377+
}
378+
}
361379
}
362380

363381
void interpreter::init_preamble()

0 commit comments

Comments
 (0)