From 477983a0f40ccd45198a08942855f23d24cc38c9 Mon Sep 17 00:00:00 2001 From: Clonkk Date: Mon, 11 Apr 2022 12:01:32 +0200 Subject: [PATCH] fix using getCurrentDir in absolutePath at compile time causing a build error --- nimjl.nimble | 2 +- nimjl/config.nim | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nimjl.nimble b/nimjl.nimble index bc0dd39..8ecca9a 100644 --- a/nimjl.nimble +++ b/nimjl.nimble @@ -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" diff --git a/nimjl/config.nim b/nimjl/config.nim index 5000741..dd3b854 100644 --- a/nimjl/config.nim +++ b/nimjl/config.nim @@ -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"