cling icon indicating copy to clipboard operation
cling copied to clipboard

Auto-include / auto-exec on cling startup

Open nerd-qp opened this issue 6 years ago • 6 comments

Scenario: I have a project, with build tools of cmake, when I try to run it with cling. It prompts some headers are not included.

So I was wondering if there is a way to make use of the cmake script to load the build environment into cling and run directly?

Appreciate the great work!

nerd-qp avatar Apr 17 '18 02:04 nerd-qp

C++ modules might help. Or create a header that includes your files, and include that at startup. We don't have a cling_logon.C mechanism yet (we have that for ROOT) - I'd be happy to receive a PR for that. If found, that file would be "run" at startup. Maybe with cling_logon.h being included at startup.

Axel-Naumann avatar Jun 12 '18 08:06 Axel-Naumann

I would like to work on this issue.

I have a doubt. Where will cling look for the file during startup? Will it be in the current working directory, a specific directory for cling, or in the PATH?

sudo-panda avatar Mar 16 '21 13:03 sudo-panda

We can learn from other tools, such as where gdb searches for .gdb_init - that seems like a good start.

Axel-Naumann avatar Mar 16 '21 14:03 Axel-Naumann

Will .cling_init be a C/C++ file or do we add support for cling commands too?

sudo-panda avatar Mar 17 '21 19:03 sudo-panda

I'd say we should support cling commands, too - this isn't a header but should contain prompt input.

Axel-Naumann avatar Mar 18 '21 15:03 Axel-Naumann

@Axel-Naumann my current PR supports cling commands, could you please review it.

sudo-panda avatar Mar 18 '21 15:03 sudo-panda