diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index 82cf5afb91970..3a0e3daa4d730 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -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(), @@ -307,7 +333,8 @@ const icc(), clangcl(), hipcc(), - nvcc()] + nvcc(), + nifc()] hExt* = ".h" @@ -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 = diff --git a/compiler/main.nim b/compiler/main.nim index 4c52317cfae70..5fe0be9315b8f 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -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) diff --git a/compiler/options.nim b/compiler/options.nim index 22af4bbd00dd4..bf6325840967e 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -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