Skip to content

Commit

Permalink
add outline for calling nifc, doesn't do anything for now
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Dec 2, 2024
1 parent 9c95831 commit 987fb06
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
32 changes: 31 additions & 1 deletion compiler/extccomp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,32 @@ compiler envcc:
cppXsupport: "",
props: {hasGnuAsm})

compiler nifc:
# no purpose other than config/exe path
result = (
name: "nifc",
objExt: "o",
optSpeed: "",
optSize: "",
compilerExe: "nifc",
cppCompiler: "",
compileTmpl: "",
buildGui: "",
buildDll: "",
buildLib: "",
linkerExe: "",
linkTmpl: "",
includeCmd: "",
linkDirCmd: "",
linkLibCmd: "",
debug: " -g ",
pic: "",
asmStmtFrmt: "",
structStmtFmt: "",
produceAsm: "",
cppXsupport: "",
props: {})

const
CC*: array[succ(low(TSystemCC))..high(TSystemCC), TInfoCC] = [
gcc(),
Expand All @@ -307,7 +333,8 @@ const
icc(),
clangcl(),
hipcc(),
nvcc()]
nvcc(),
nifc()]

hExt* = ".h"

Expand Down Expand Up @@ -996,6 +1023,9 @@ proc callCCompiler*(conf: ConfigRef) =
script.add("\n")
generateScript(conf, script)

proc callNifc*(conf: ConfigRef) =
discard

template hashNimExe(): string = $secureHashFile(os.getAppFilename())

proc jsonBuildInstructionsFile*(conf: ConfigRef): AbsoluteFile =
Expand Down
5 changes: 4 additions & 1 deletion compiler/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ proc commandCompileToC(graph: ModuleGraph) =
if graph.backend != nil:
cgenWriteModules(graph.backend, conf)
if conf.cmd != cmdTcc and graph.backend != nil:
extccomp.callCCompiler(conf)
when defined(nimCompileToNifc):
extccomp.callNifc(conf)
else:
extccomp.callCCompiler(conf)
# for now we do not support writing out a .json file with the build instructions when HCR is on
if not conf.hcrOn:
extccomp.writeJsonBuildInstructions(conf, graph.cachedFiles)
Expand Down
3 changes: 2 additions & 1 deletion compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ type

TSystemCC* = enum
ccNone, ccGcc, ccNintendoSwitch, ccLLVM_Gcc, ccCLang, ccBcc, ccVcc,
ccTcc, ccEnv, ccIcl, ccIcc, ccClangCl, ccHipcc, ccNvcc
ccTcc, ccEnv, ccIcl, ccIcc, ccClangCl, ccHipcc, ccNvcc,
ccNifc # no purpose other than exe config etc

ExceptionSystem* = enum
excNone, # no exception system selected yet
Expand Down

0 comments on commit 987fb06

Please sign in to comment.