diff options
author | Zahary Karadjov <zahary@gmail.com> | 2011-11-25 17:19:01 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2011-11-25 17:29:55 +0200 |
commit | c617479c6848e07f25f92fd33b3397d65683812e (patch) | |
tree | 8d147e84c3f7e424c542bc444d8bb0d1d1bd0d78 /compiler/commands.nim | |
parent | ed9c7761c4e37ec22ebd81acf16e3137d064cfc9 (diff) | |
download | Nim-c617479c6848e07f25f92fd33b3397d65683812e.tar.gz |
New algorithm for locating and loading nimrod config files.
Some new options added to the compiler (see news.txt for details)
Diffstat (limited to 'compiler/commands.nim')
-rwxr-xr-x | compiler/commands.nim | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim index cf172111a..c6e00265f 100755 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -244,6 +244,10 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "out", "o": expectArg(switch, arg, pass, info) options.outFile = arg + of "mainmodule", "m": + expectArg(switch, arg, pass, info) + projectName = arg + projectFullPath = projectPath/projectName of "define", "d": expectArg(switch, arg, pass, info) DefineSymbol(arg) @@ -333,15 +337,24 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "app": expectArg(switch, arg, pass, info) case arg.normalize - of "gui": + of "gui": incl(gGlobalOptions, optGenGuiApp) + defineSymbol("executable") defineSymbol("guiapp") - of "console": + of "console": excl(gGlobalOptions, optGenGuiApp) - of "lib": + defineSymbol("executable") + defineSymbol("consoleapp") + of "lib": incl(gGlobalOptions, optGenDynLib) excl(gGlobalOptions, optGenGuiApp) defineSymbol("library") + defineSymbol("dll") + of "staticlib": + incl(gGlobalOptions, optGenStaticLib) + excl(gGlobalOptions, optGenGuiApp) + defineSymbol("library") + defineSymbol("staticlib") else: LocalError(info, errGuiConsoleOrLibExpectedButXFound, arg) of "passc", "t": expectArg(switch, arg, pass, info) @@ -349,12 +362,24 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "passl", "l": expectArg(switch, arg, pass, info) if pass in {passCmd2, passPP}: extccomp.addLinkOption(arg) + of "cincludes": + expectArg(switch, arg, pass, info) + if pass in {passCmd2, passPP}: cIncludes.add arg + of "clibdir": + expectArg(switch, arg, pass, info) + if pass in {passCmd2, passPP}: cLibs.add arg + of "clib": + expectArg(switch, arg, pass, info) + if pass in {passCmd2, passPP}: cLinkedLibs.add arg of "index": expectArg(switch, arg, pass, info) if pass in {passCmd2, passPP}: gIndexFile = arg - of "import": + of "import": expectArg(switch, arg, pass, info) - options.addImplicitMod(arg) + if pass in {passCmd2, passPP}: implicitImports.add arg + of "include": + expectArg(switch, arg, pass, info) + if pass in {passCmd2, passPP}: implicitIncludes.add arg of "listcmd": expectNoArg(switch, arg, pass, info) incl(gGlobalOptions, optListCmd) @@ -405,6 +430,9 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "skipprojcfg": expectNoArg(switch, arg, pass, info) incl(gGlobalOptions, optSkipProjConfigFile) + of "skipusercfg": + expectNoArg(switch, arg, pass, info) + incl(gGlobalOptions, optSkipUserConfigFile) of "genscript": expectNoArg(switch, arg, pass, info) incl(gGlobalOptions, optGenScript) |