Skip to content

Commit

Permalink
Implement --get-rtlib-header-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Jun 20, 2022
1 parent b55113d commit cf12dce
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/bin/lpython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ int compile_python_to_object_file(

#endif

void do_print_rtlib_header_dir() {
std::string rtlib_header_dir = LFortran::get_runtime_library_header_dir();
std::cout << rtlib_header_dir << std::endl;
}


// infile is an object file
// outfile will become the executable
Expand Down Expand Up @@ -594,6 +599,7 @@ int main(int argc, char *argv[])
std::string arg_backend = "llvm";
std::string arg_kernel_f;
bool print_targets = false;
bool print_rtlib_header_dir = false;

std::string arg_fmt_file;
// int arg_fmt_indent = 4;
Expand Down Expand Up @@ -656,6 +662,7 @@ int main(int argc, char *argv[])
app.add_flag("--fast", compiler_options.fast, "Best performance (disable strict standard compliance)");
app.add_option("--target", compiler_options.target, "Generate code for the given target")->capture_default_str();
app.add_flag("--print-targets", print_targets, "Print the registered targets");
app.add_flag("--get-rtlib-header-dir", print_rtlib_header_dir, "Print the path to the runtime library header file");

/*
* Subcommands:
Expand Down Expand Up @@ -718,6 +725,11 @@ int main(int argc, char *argv[])
#endif
}

if (print_rtlib_header_dir) {
do_print_rtlib_header_dir();
return 0;
}

compiler_options.use_colors = !arg_no_color;

// if (fmt) {
Expand Down

0 comments on commit cf12dce

Please sign in to comment.