diff --git a/config.nims b/config.nims new file mode 100644 index 0000000..20370d4 --- /dev/null +++ b/config.nims @@ -0,0 +1,2 @@ +if defined(macosx): + switch("passl", "-L/Library/Developer/CommandLineTools/usr/lib/") diff --git a/src/futhark.nim b/src/futhark.nim index d6ae729..5100b97 100644 --- a/src/futhark.nim +++ b/src/futhark.nim @@ -649,6 +649,14 @@ macro importc*(imports: varargs[untyped]): untyped = let clangIncludePath = getClangIncludePath() if clangIncludePath != "": cargs.add newLit("-I" & clangIncludePath) + when defined(macosx): + var sdkVersion = getenv("MAC_SDK") + + if sdkVersion == "": + sdkVersion = "14" + cargs.add newLit("-I/Library/Developer/CommandLineTools/SDKs/MacOSX" & + sdkVersion & ".sdk/usr/include") + result.add quote do: importcImpl(`defs`, `outputPath`, `cargs`, `files`, `importDirs`, `renames`, `retypes`, RenameCallback(`renameCallback`), OpirCallbacks(`opirCallbacks`), `forwards`) proc hash*(n: NimNode): Hash = hash(n.treeRepr)