1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-05-28 13:41:31 +00:00

Fix #106: the current working directory should be always included in the include path

This commit is contained in:
Karol Stasiak 2021-03-13 21:42:11 +01:00
parent 8aac3bc329
commit 58b5b6ff28
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,8 @@ Each module has a name, which is its unique identifier.
A module name is a sequence of slash-separated valid Millfork identifiers.
The name also defines where the module is located:
a module named `a/b` is presumed to exist in `a/b.mfk`
and it's looked up first in the current working directory,
and it's looked up first in the directory that contains the current source file,
then in the current working directory,
and then in the include directories.
A module can import other modules, using the `import` statement.

View File

@ -241,10 +241,10 @@ object Main {
log.debug(s"Failed to find the default include path: $err")
case Right(path) =>
log.debug(s"Automatically detected include path: $path")
return c.copy(includePath = List(path) ++ c.extraIncludePath)
return c.copy(includePath = List(System.getProperty("user.dir"), path) ++ c.extraIncludePath)
}
}
c.copy(includePath = c.includePath ++ c.extraIncludePath)
c.copy(includePath = System.getProperty("user.dir") :: (c.includePath ++ c.extraIncludePath))
}
private def assembleForMos(c: Context, platform: Platform, options: CompilationOptions): AssemblerOutput = {