Mercurial > games > semicongine
comparison config.nims @ 46:9e81f06a5c57
add: some changes to build on windows host
author | Sam <sam@basx.dev> |
---|---|
date | Thu, 19 Jan 2023 00:42:40 +0700 |
parents | 5a6aadf6c464 |
children | 4c3891eb9ef9 |
comparison
equal
deleted
inserted
replaced
45:2378ada1a14e | 46:9e81f06a5c57 |
---|---|
40 mkDir(BUILDBASE / RELEASE / LINUX) | 40 mkDir(BUILDBASE / RELEASE / LINUX) |
41 | 41 |
42 task single_windows_debug, "build windows debug": | 42 task single_windows_debug, "build windows debug": |
43 compilerFlags() | 43 compilerFlags() |
44 compilerFlagsDebug() | 44 compilerFlagsDebug() |
45 # for some the --define:mingw does not work from inside here... | |
46 # so we need to set it when calling the task and use "/" to prevent | |
47 # the use of backslash while crosscompiling | |
48 switch("define", "mingw") | |
49 switch("outdir", BUILDBASE & "/" & DEBUG & "/" & WINDOWS) | 45 switch("outdir", BUILDBASE & "/" & DEBUG & "/" & WINDOWS) |
50 setCommand "c" | 46 setCommand "c" |
51 mkDir(BUILDBASE & "/" & DEBUG & "/" & WINDOWS) | 47 mkDir(BUILDBASE & "/" & DEBUG & "/" & WINDOWS) |
48 | |
52 | 49 |
53 task single_windows_release, "build windows release": | 50 task single_windows_release, "build windows release": |
54 compilerFlags() | 51 compilerFlags() |
55 compilerFlagsRelease() | 52 compilerFlagsRelease() |
56 switch("outdir", BUILDBASE & "/" & RELEASE & "/" & WINDOWS) | 53 switch("outdir", BUILDBASE & "/" & RELEASE & "/" & WINDOWS) |
57 switch("define", "mingw") | |
58 setCommand "c" | 54 setCommand "c" |
59 mkDir(BUILDBASE & "/" & RELEASE & "/" & WINDOWS) | 55 mkDir(BUILDBASE & "/" & RELEASE & "/" & WINDOWS) |
56 | |
57 task single_crosscompile_windows_debug, "build crosscompile windows debug": | |
58 switch("define", "mingw") | |
59 single_windows_debugTask() | |
60 | |
61 task single_crosscompile_windows_release, "build crosscompile windows release": | |
62 switch("define", "mingw") | |
63 single_windows_releaseTask() | |
60 | 64 |
61 task build_all_linux_debug, "build all examples with linux/debug": | 65 task build_all_linux_debug, "build all examples with linux/debug": |
62 for file in listFiles("examples"): | 66 for file in listFiles("examples"): |
63 if file.endsWith(".nim"): | 67 if file.endsWith(".nim"): |
64 selfExec(&"single_linux_debug {file}") | 68 selfExec(&"single_linux_debug {file}") |
118 exec &"cd {dirname} && wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip" | 122 exec &"cd {dirname} && wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip" |
119 exec &"cd {dirname} && unzip *.zip" | 123 exec &"cd {dirname} && unzip *.zip" |
120 exec &"mv {dirname}/bin/glslangValidator.exe examples/" | 124 exec &"mv {dirname}/bin/glslangValidator.exe examples/" |
121 exec &"rm -rf {dirname}" | 125 exec &"rm -rf {dirname}" |
122 | 126 |
123 if getCommand() in ["c", "compile", "r", "dump", "check", "idetools"]: | |
124 compilerFlags() | |
125 | |
126 task run_all , "Run all binaries": | 127 task run_all , "Run all binaries": |
127 for file in listFiles("build/debug/linux"): | 128 for file in listFiles("build/debug/linux"): |
128 exec file | 129 exec file |
129 for file in listFiles("build/release/linux"): | 130 for file in listFiles("build/release/linux"): |
130 exec file | 131 exec file |
131 for file in listFiles("build/debug/windows"): | 132 for file in listFiles("build/debug/windows"): |
132 exec &"wine {file}" | 133 exec &"wine {file}" |
133 for file in listFiles("build/release/windows"): | 134 for file in listFiles("build/release/windows"): |
134 exec &"wine {file}" | 135 exec &"wine {file}" |
136 | |
137 if getCommand() in ["c", "compile", "r", "dump", "check", "idetools"]: | |
138 compilerFlags() |