Skip to content

Commit

Permalink
added FICUS_PATH environment variable support that helps to detect th…
Browse files Browse the repository at this point in the history
…e standard library
  • Loading branch information
vpisarev committed Mar 25, 2021
1 parent 39e22fc commit a526bd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/Compiler.fx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ fun parse_all(fname0: string): bool
val dir0 = Filename.dirname(fname0)
val inc_dirs0 = if dir0 == cwd { cwd :: [] } else { dir0 :: cwd :: [] }
val inc_dirs0 = inc_dirs0 + Options.opt.include_path
val inc_dirs0 = inc_dirs0 + Sys.getpath("FICUS_PATH")
val inc_dirs0 = [: for d <- inc_dirs0 { Filename.normalize(cwd, d) } :]
val name0_id = Ast.get_id(Filename.remove_extension(Filename.basename(fname0)))
val minfo = Ast.find_module(name0_id, fname0)
Expand Down
6 changes: 6 additions & 0 deletions lib/Sys.fx
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,9 @@ fun getenv(name: string): string = @ccode {
}
return fx_status;
}

fun getpath(name: string): string list
{
val pathsep = if win32 {';'} else {':'}
getenv(name).split(pathsep)
}

0 comments on commit a526bd3

Please sign in to comment.