Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't pass extra includes; configure this with flags #493

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,10 @@ install(TARGETS xcpp
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

# Configuration and data directories for jupyter and xeus-cling
set(XJUPYTER_DATA_DIR "share/jupyter" CACHE STRING "Jupyter data directory")
set(XEUS_CLING_DATA_DIR "share/xeus-cling" CACHE STRING "xeus-cling data directory")
set(XEUS_CLING_CONF_DIR "etc/xeus-cling" CACHE STRING "xeus-cling configuration directory")
set(XJUPYTER_DATA_DIR "share/jupyter" CACHE STRING "Jupyter data directory")
set(XEUS_CLING_DATA_DIR "share/xeus-cling" CACHE STRING "xeus-cling data directory")
set(XEUS_CLING_CONF_DIR "etc/xeus-cling" CACHE STRING "xeus-cling configuration directory")
set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE STRING "Path to llvm/include")

# Install xcpp headers
install(FILES ${XCPP_HEADERS}
Expand Down
1 change: 1 addition & 0 deletions share/jupyter/kernels/xcpp11/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"@XEUS_CLING_KERNELSPEC_PATH@/xcpp",
"-f",
"{connection_file}",
"-I", "@LLVM_MAIN_INCLUDE_DIR@",
"-std=c++11"
],
"language": "C++11"
Expand Down
1 change: 1 addition & 0 deletions share/jupyter/kernels/xcpp14/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"@XEUS_CLING_KERNELSPEC_PATH@/xcpp",
"-f",
"{connection_file}",
"-I", "@LLVM_MAIN_INCLUDE_DIR@",
"-std=c++14"
],
"language": "C++14"
Expand Down
1 change: 1 addition & 0 deletions share/jupyter/kernels/xcpp17/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"@XEUS_CLING_KERNELSPEC_PATH@/xcpp",
"-f",
"{connection_file}",
"-I", "@LLVM_MAIN_INCLUDE_DIR@",
"-std=c++17"
],
"language": "C++17"
Expand Down
4 changes: 1 addition & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,14 @@ using interpreter_ptr = std::unique_ptr<xcpp::interpreter>;

interpreter_ptr build_interpreter(int argc, char** argv)
{
int interpreter_argc = argc + 1;
int interpreter_argc = argc;
const char** interpreter_argv = new const char*[interpreter_argc];
interpreter_argv[0] = "xeus-cling";
// Copy all arguments in the new array excepting the process name.
for (int i = 1; i < argc; i++)
{
interpreter_argv[i] = argv[i];
}
std::string include_dir = std::string(LLVM_DIR) + std::string("/include");
interpreter_argv[interpreter_argc - 1] = include_dir.c_str();

interpreter_ptr interp_ptr = interpreter_ptr(new xcpp::interpreter(interpreter_argc, interpreter_argv));
delete[] interpreter_argv;
Expand Down