summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorrku <rokups@zoho.com>2015-07-31 15:57:10 +0300
committerrku <rokups@zoho.com>2015-07-31 15:57:10 +0300
commit626226efa40441d03b2f9121e2a73faaa44b2517 (patch)
tree96151de7d832f40976adc16089b96bc8bc5c176a
parentc9084585dc507267d48c5f79674847da7fc4a6bb (diff)
downloadNim-626226efa40441d03b2f9121e2a73faaa44b2517.tar.gz
{.compile.} pragma accepts paths relative to file pragma is in.
-rw-r--r--compiler/pragmas.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index c771155af..650b0e195 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -395,6 +395,8 @@ proc processCompile(c: PContext, n: PNode) =
   var found = findFile(s)
   if found == "": found = s
   var trunc = changeFileExt(found, "")
+  if not isAbsolute(found):
+    found = parentDir(n.info.toFullPath) / found
   extccomp.addExternalFileToCompile(found)
   extccomp.addFileToLink(completeCFilePath(trunc, false))