Mercurial > games > semicongine
annotate config.nims @ 1256:bfb75c934f4e
add: window focus handling, improve window api a bit
author | sam <sam@basx.dev> |
---|---|
date | Sun, 28 Jul 2024 17:33:41 +0700 |
parents | 55896320c8bf |
children | 3cd5fd36150e |
rev | line source |
---|---|
33
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
1 import std/strformat |
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
2 import std/strutils |
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
3 import std/os |
18 | 4 |
1223
55896320c8bf
fix: references to new package not updated
sam <sam@basx.dev>
parents:
1222
diff
changeset
|
5 import semiconginev2/build |
18 | 6 |
950
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
7 task build_dev, "build dev": |
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
8 semicongine_build_switches(buildname = "dev") |
18 | 9 setCommand "c" |
950
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
10 let outdir = semicongine_builddir(buildname = "dev") |
979 | 11 semicongine_pack(outdir, bundleType = "exe", resourceRoot = "tests/resources", withSteam = false) |
12 | |
13 task build_dev_zip, "build dev zip": | |
14 semicongine_build_switches(buildname = "dev") | |
15 setCommand "c" | |
16 let outdir = semicongine_builddir(buildname = "dev") | |
17 semicongine_pack(outdir, bundleType = "zip", resourceRoot = "tests/resources", withSteam = false) | |
18 | |
19 task build_dev_dir, "build dev dir": | |
20 semicongine_build_switches(buildname = "dev") | |
21 setCommand "c" | |
22 let outdir = semicongine_builddir(buildname = "dev") | |
23 semicongine_pack(outdir, bundleType = "dir", resourceRoot = "tests/resources", withSteam = false) | |
950
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
24 |
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
25 task build_release, "build release": |
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
26 switch "define", "release" |
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
27 switch "app", "gui" |
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
28 semicongine_build_switches(buildname = "release") |
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
29 setCommand "c" |
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
30 let outdir = semicongine_builddir(buildname = "release") |
979 | 31 semicongine_pack(outdir, bundleType = "exe", resourceRoot = "tests/resources", withSteam = false) |
950
fe48b091e83f
did: tons of small improvments, on the way to make GPU sync (more) correct I guess
sam <sam@basx.dev>
parents:
438
diff
changeset
|
32 |
18 | 33 |
213
b5d9410a8184
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
207
diff
changeset
|
34 task build_all_debug, "build all examples for debug": |
33
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
35 for file in listFiles("examples"): |
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
36 if file.endsWith(".nim"): |
213
b5d9410a8184
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
207
diff
changeset
|
37 exec(&"nim build {file}") |
33
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
38 |
213
b5d9410a8184
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
207
diff
changeset
|
39 task build_all_release, "build all examples for release": |
33
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
40 for file in listFiles("examples"): |
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
41 if file.endsWith(".nim"): |
213
b5d9410a8184
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
207
diff
changeset
|
42 exec(&"nim build -d:release {file}") |
33
94c38e4b5782
did: refactoring, move more from make to nimscript
Sam <sam@basx.dev>
parents:
24
diff
changeset
|
43 |
316
b145a05c2459
add: changing rendering system, not finished yet, also upgrading to Nim 2
Sam <sam@basx.dev>
parents:
273
diff
changeset
|
44 task test_all, "Run all test programs": |
b145a05c2459
add: changing rendering system, not finished yet, also upgrading to Nim 2
Sam <sam@basx.dev>
parents:
273
diff
changeset
|
45 for file in listFiles("tests"): |
438 | 46 if file.endsWith(".nim") and not file.endsWith("test_resources.nim"): |
979 | 47 exec(&"nim build_dev --run {file}") |
316
b145a05c2459
add: changing rendering system, not finished yet, also upgrading to Nim 2
Sam <sam@basx.dev>
parents:
273
diff
changeset
|
48 |
979 | 49 exec("nim build_dev --run tests/test_resources.nim") |
50 exec("nim build_dev_zip --run tests/test_resources.nim") | |
51 exec("nim build_dev_dir --run tests/test_resources.nim") | |
438 | 52 |
62
7153eadb07eb
fix: some formatting, bug when opening on windows.
Sam <sam@basx.dev>
parents:
55
diff
changeset
|
53 task run_all, "Run all binaries": |
39 | 54 for file in listFiles("build/debug/linux"): |
55 exec file | |
56 for file in listFiles("build/release/linux"): | |
57 exec file | |
58 for file in listFiles("build/debug/windows"): | |
59 exec &"wine {file}" | |
60 for file in listFiles("build/release/windows"): | |
61 exec &"wine {file}" | |
46
9e81f06a5c57
add: some changes to build on windows host
Sam <sam@basx.dev>
parents:
44
diff
changeset
|
62 |
9e81f06a5c57
add: some changes to build on windows host
Sam <sam@basx.dev>
parents:
44
diff
changeset
|
63 if getCommand() in ["c", "compile", "r", "dump", "check", "idetools"]: |
213
b5d9410a8184
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
207
diff
changeset
|
64 if defined(linux): |
438 | 65 --d: VK_USE_PLATFORM_XLIB_KHR |
213
b5d9410a8184
add: resource packaging and loading for different resource types, simplify build commands, update readme
Sam <sam@basx.dev>
parents:
207
diff
changeset
|
66 if defined(windows): |
438 | 67 --d: VK_USE_PLATFORM_WIN32_KHR |