mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-22 00:41:28 +00:00
win64 is a supported target; bugfix: nimrod c -r on windows; stdlib uses wide char versions of the WinAPI
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# The GC is still too fragile; I don't want that ``--replace`` does bad things
|
||||
# to important files. Nimgrep does not really need a GC anyway.
|
||||
# The GC is stable enough now:
|
||||
|
||||
#--gc:none
|
||||
|
||||
--gc:none
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#! stdtmpl(subsChar='?') | standard
|
||||
#proc GenerateBuildBatchScript(c: TConfigData): string =
|
||||
#proc GenerateBuildBatchScript(c: TConfigData, target: TTarget): string =
|
||||
# result = "@echo off\nREM Generated by niminst\n"
|
||||
SET CC=gcc
|
||||
SET LINKER=gcc
|
||||
@@ -8,13 +8,9 @@ SET LINK_FLAGS=?{c.linker.flags}
|
||||
|
||||
REM call the compiler:
|
||||
|
||||
IF EXIST %SystemRoot%\SysWOW64 GOTO :Win64
|
||||
|
||||
ECHO Building for Win32
|
||||
|
||||
# block win32:
|
||||
# var linkCmd = ""
|
||||
# for ff in items(c.cfiles[1][1]):
|
||||
# for ff in items(c.cfiles[1][ord(target)]):
|
||||
# let f = ff.replace('/', '\\')
|
||||
ECHO %CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
|
||||
%CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
|
||||
@@ -26,25 +22,4 @@ ECHO %LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd
|
||||
|
||||
# end block
|
||||
|
||||
GOTO :end
|
||||
|
||||
:Win64
|
||||
ECHO Building for Win64
|
||||
|
||||
# block win64:
|
||||
# var linkCmd = ""
|
||||
# for ff in items(c.cfiles[1][2]):
|
||||
# let f = ff.replace('/', '\\')
|
||||
ECHO %CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
|
||||
%CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
|
||||
# linkCmd.add(" " & changeFileExt(f, "o"))
|
||||
# end for
|
||||
|
||||
ECHO %LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd
|
||||
%LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd
|
||||
|
||||
# end block
|
||||
|
||||
:end
|
||||
|
||||
ECHO SUCCESS
|
||||
|
||||
@@ -20,12 +20,14 @@ const
|
||||
maxOS = 20 # max number of OSes
|
||||
maxCPU = 10 # max number of CPUs
|
||||
buildShFile = "build.sh"
|
||||
buildBatFile = "build.bat"
|
||||
buildBatFile32 = "build.bat"
|
||||
buildBatFile64 = "build64.bat"
|
||||
installShFile = "install.sh"
|
||||
deinstallShFile = "deinstall.sh"
|
||||
|
||||
type
|
||||
TAppType = enum appConsole, appGUI
|
||||
TTarget = enum tWin32 = 1, tWin64 = 2
|
||||
TAction = enum
|
||||
actionNone, # action not yet known
|
||||
actionCSource # action: create C sources
|
||||
@@ -404,7 +406,8 @@ proc srcdist(c: var TConfigData) =
|
||||
# second pass: remove duplicate files
|
||||
removeDuplicateFiles(c)
|
||||
writeFile(buildShFile, GenerateBuildShellScript(c), "\10")
|
||||
writeFile(buildBatFile, GenerateBuildBatchScript(c), "\13\10")
|
||||
writeFile(buildBatFile32, GenerateBuildBatchScript(c, tWin32), "\13\10")
|
||||
writeFile(buildBatFile64, GenerateBuildBatchScript(c, tWin64), "\13\10")
|
||||
if c.installScript:
|
||||
writeFile(installShFile, GenerateInstallScript(c), "\10")
|
||||
if c.uninstallScript:
|
||||
@@ -436,7 +439,8 @@ when haveZipLib:
|
||||
else: n = c.outdir / n
|
||||
var z: TZipArchive
|
||||
if open(z, n, fmWrite):
|
||||
addFile(z, proj / buildBatFile, buildBatFile)
|
||||
addFile(z, proj / buildBatFile32, buildBatFile32)
|
||||
addFile(z, proj / buildBatFile64, buildBatFile64)
|
||||
addFile(z, proj / buildShFile, buildShFile)
|
||||
addFile(z, proj / installShFile, installShFile)
|
||||
addFile(z, proj / deinstallShFile, deinstallShFile)
|
||||
|
||||
Reference in New Issue
Block a user