File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,27 @@ std::string get_runtime_library_header_dir()
79
79
char *env_p = std::getenv (" LFORTRAN_RUNTIME_LIBRARY_HEADER_DIR" );
80
80
if (env_p) return env_p;
81
81
82
- return get_runtime_library_dir () + " /impure" ;
82
+ // The header file is in src/libasr/runtime for development, but in impure
83
+ // in installed version
84
+ std::string path;
85
+ int dirname_length;
86
+ get_executable_path (path, dirname_length);
87
+ std::string dirname = path.substr (0 ,dirname_length);
88
+ if ( endswith (dirname, " src/bin" )
89
+ || endswith (dirname, " src\\ bin" )
90
+ || endswith (dirname, " SRC\\ BIN" )) {
91
+ // Development version
92
+ return dirname + " /../libasr/runtime" ;
93
+ } else if (endswith (dirname, " src/lpython/tests" ) ||
94
+ endswith (to_lower (dirname), " src\\ lpython\\ tests" )) {
95
+ // CTest Tests
96
+ return dirname + " /../../libasr/runtime" ;
97
+ } else {
98
+ // Installed version
99
+ return dirname + " /../share/lpython/lib/impure" ;
100
+ }
101
+
102
+ return path;
83
103
}
84
104
85
105
bool is_directory (std::string path) {
You can’t perform that action at this time.
0 commit comments