mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add more paths to search for the standard library
Module `std` is searched first in a `c3` subdirectory. Search directories are, in order and relative to the compiler executable location: - `lib/c3` relative to the parent directory - `lib` relative to the parent directory - `/lib/c3` - `/lib` - `/c3` - `/` - `c3` relative to the parent directory - the parent directory - `lib/c3` relative to the grand-parent directory - `lib` relative to the grand-parent directory
This commit is contained in:
committed by
Christoffer Lerno
parent
9b61ddb876
commit
7df5bc0017
@@ -381,10 +381,15 @@ const char *find_lib_dir(void)
|
||||
path[strlen_path - 1] = '\0';
|
||||
}
|
||||
const char *lib_path = NULL;
|
||||
if ((lib_path = lib_find(path, "/../lib/c3"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/../lib/"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/lib/c3"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/lib/"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/c3"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/../c3"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/../"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/../../lib/c3"))) goto DONE;
|
||||
if ((lib_path = lib_find(path, "/../../lib/"))) goto DONE;
|
||||
|
||||
DEBUG_LOG("Could not find the standard library /lib/std/");
|
||||
|
||||
Reference in New Issue
Block a user