Skip to content

Commit

Permalink
fix using getCurrentDir in absolutePath at compile time causing a bui…
Browse files Browse the repository at this point in the history
…ld error
  • Loading branch information
Clonkk committed Apr 11, 2022
1 parent 0c65227 commit 477983a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nimjl.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nimjl
# Licensed and distributed under MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
version = "0.7.2"
version = "0.7.3"
author = "Regis Caillaud"
description = "Nim Julia bridge"
license = "MIT"
Expand Down
8 changes: 4 additions & 4 deletions nimjl/config.nim
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import std/os
import std/strutils

const JuliaBinPath = gorge("julia -E Sys.BINDIR").replace("\"", "")
proc JuliaBinPath*() : string {.compileTime.} =
gorge("julia -E Sys.BINDIR").replace("\"", "")

# JuliaPath should be parent folder of Julia-bindir
# This is resolved AT COMPILE TIME. Therefore, using the environment of the machine that compile.
# If you want to ship a binary, you need to install in a fixed path and pass this path using -d:JuliaPath="/path/to/Julia"
const JuliaPath* {.strdefine.} = if not existsEnv("JULIA_PATH"): JuliaBinPath.parentDir().normalizedPath().absolutePath() else: getEnv("JULIA_PATH")
static:
echo JuliaPath
const JuliaPath* {.strdefine.} = if not existsEnv("JULIA_PATH"): JuliaBinPath().parentDir().normalizedPath() else: getEnv("JULIA_PATH")

const JuliaIncludesPath* = JuliaPath / "include" / "julia"
const JuliaHeader* = "julia.h"
const JuliaLibPath* = JuliaPath / "lib"
Expand Down

0 comments on commit 477983a

Please sign in to comment.