Skip to content

Commit e9453fd

Browse files
authored
Merge pull request #1772 from certik/rtl
Implement --get-rtl-dir
2 parents 305f096 + 9b5ec2e commit e9453fd

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

src/bin/lpython.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,14 @@ int compile_python_to_object_file(
809809

810810
#endif
811811

812-
void do_print_rtlib_header_dir() {
813-
std::string rtlib_header_dir = LCompilers::LPython::get_runtime_library_header_dir();
814-
std::cout << rtlib_header_dir << std::endl;
812+
void do_print_rtl_header_dir() {
813+
std::string rtl_header_dir = LCompilers::LPython::get_runtime_library_header_dir();
814+
std::cout << rtl_header_dir << std::endl;
815+
}
816+
817+
void do_print_rtl_dir() {
818+
std::string rtl_dir = LCompilers::LPython::get_runtime_library_dir();
819+
std::cout << rtl_dir << std::endl;
815820
}
816821

817822
int compile_to_binary_wasm(
@@ -1436,7 +1441,8 @@ int main(int argc, char *argv[])
14361441
std::string arg_backend = "llvm";
14371442
std::string arg_kernel_f;
14381443
bool print_targets = false;
1439-
bool print_rtlib_header_dir = false;
1444+
bool print_rtl_header_dir = false;
1445+
bool print_rtl_dir = false;
14401446

14411447
std::string arg_fmt_file;
14421448
// int arg_fmt_indent = 4;
@@ -1507,7 +1513,8 @@ int main(int argc, char *argv[])
15071513
app.add_flag("--fast", compiler_options.fast, "Best performance (disable strict standard compliance)");
15081514
app.add_option("--target", compiler_options.target, "Generate code for the given target")->capture_default_str();
15091515
app.add_flag("--print-targets", print_targets, "Print the registered targets");
1510-
app.add_flag("--get-rtlib-header-dir", print_rtlib_header_dir, "Print the path to the runtime library header file");
1516+
app.add_flag("--get-rtl-header-dir", print_rtl_header_dir, "Print the path to the runtime library header file");
1517+
app.add_flag("--get-rtl-dir", print_rtl_dir, "Print the path to the runtime library file");
15111518
app.add_flag("--verbose", compiler_options.verbose, "Print debugging statements");
15121519

15131520
// LSP specific options
@@ -1585,8 +1592,13 @@ int main(int argc, char *argv[])
15851592
#endif
15861593
}
15871594

1588-
if (print_rtlib_header_dir) {
1589-
do_print_rtlib_header_dir();
1595+
if (print_rtl_header_dir) {
1596+
do_print_rtl_header_dir();
1597+
return 0;
1598+
}
1599+
1600+
if (print_rtl_dir) {
1601+
do_print_rtl_dir();
15901602
return 0;
15911603
}
15921604

0 commit comments

Comments
 (0)