Mercurial > games > semicongine
comparison config.nims @ 194:93f661a20f74
did: a bit of cleanup with the config, also add some documentation
| author | Sam <sam@basx.dev> |
|---|---|
| date | Sun, 07 May 2023 00:23:46 +0700 |
| parents | 5e19aead2b61 |
| children | 81fab407a479 |
comparison
equal
deleted
inserted
replaced
| 193:ee1aea493736 | 194:93f661a20f74 |
|---|---|
| 19 switch("define", "VK_USE_PLATFORM_WIN32_KHR") | 19 switch("define", "VK_USE_PLATFORM_WIN32_KHR") |
| 20 | 20 |
| 21 | 21 |
| 22 proc compilerFlagsDebug() = | 22 proc compilerFlagsDebug() = |
| 23 switch("debugger", "native") | 23 switch("debugger", "native") |
| 24 switch("checks", "on") | |
| 25 switch("assertions", "on") | |
| 26 | 24 |
| 27 proc compilerFlagsRelease() = | 25 proc compilerFlagsRelease() = |
| 28 switch("define", "release") | 26 switch("define", "release") |
| 29 switch("checks", "off") | |
| 30 switch("assertions", "off") | |
| 31 switch("app", "gui") | 27 switch("app", "gui") |
| 32 | 28 |
| 33 task single_linux_debug, "build linux debug": | 29 task single_linux_debug, "build linux debug": |
| 34 compilerFlags() | 30 compilerFlags() |
| 35 compilerFlagsDebug() | 31 compilerFlagsDebug() |
| 49 compilerFlagsDebug() | 45 compilerFlagsDebug() |
| 50 switch("outdir", BUILDBASE & "/" & DEBUG & "/" & WINDOWS) | 46 switch("outdir", BUILDBASE & "/" & DEBUG & "/" & WINDOWS) |
| 51 setCommand "c" | 47 setCommand "c" |
| 52 mkDir(BUILDBASE & "/" & DEBUG & "/" & WINDOWS) | 48 mkDir(BUILDBASE & "/" & DEBUG & "/" & WINDOWS) |
| 53 | 49 |
| 54 | |
| 55 task single_windows_release, "build windows release": | 50 task single_windows_release, "build windows release": |
| 56 compilerFlags() | 51 compilerFlags() |
| 57 compilerFlagsRelease() | 52 compilerFlagsRelease() |
| 58 switch("outdir", BUILDBASE & "/" & RELEASE & "/" & WINDOWS) | 53 switch("outdir", BUILDBASE & "/" & RELEASE & "/" & WINDOWS) |
| 59 setCommand "c" | 54 setCommand "c" |
| 60 mkDir(BUILDBASE & "/" & RELEASE & "/" & WINDOWS) | 55 mkDir(BUILDBASE & "/" & RELEASE & "/" & WINDOWS) |
| 61 | |
| 62 task single_crosscompile_windows_debug, "build crosscompile windows debug": | |
| 63 switch("define", "mingw") | |
| 64 single_windows_debugTask() | |
| 65 | |
| 66 task single_crosscompile_windows_release, "build crosscompile windows release": | |
| 67 switch("define", "mingw") | |
| 68 single_windows_releaseTask() | |
| 69 | 56 |
| 70 task build_all_linux_debug, "build all examples with linux/debug": | 57 task build_all_linux_debug, "build all examples with linux/debug": |
| 71 for file in listFiles("examples"): | 58 for file in listFiles("examples"): |
| 72 if file.endsWith(".nim"): | 59 if file.endsWith(".nim"): |
| 73 selfExec(&"single_linux_debug {file}") | 60 selfExec(&"single_linux_debug {file}") |
| 147 exec &"wine {file}" | 134 exec &"wine {file}" |
| 148 | 135 |
| 149 task get_vulkan_wrapper, "Download vulkan wrapper": | 136 task get_vulkan_wrapper, "Download vulkan wrapper": |
| 150 exec &"curl https://raw.githubusercontent.com/nimgl/nimgl/master/src/nimgl/vulkan.nim > src/semicongine/vulkan/c_api.nim" | 137 exec &"curl https://raw.githubusercontent.com/nimgl/nimgl/master/src/nimgl/vulkan.nim > src/semicongine/vulkan/c_api.nim" |
| 151 | 138 |
| 152 const api_generator_name = "vulkan_api_generator" | |
| 153 | |
| 154 task generate_vulkan_api, "Generate Vulkan API": | 139 task generate_vulkan_api, "Generate Vulkan API": |
| 155 selfExec &"c -d:ssl --run src/vulkan_api/{api_generator_name}.nim" | 140 selfExec &"c -d:ssl --run src/vulkan_api/vulkan_api_generator.nim" |
| 156 mkDir "src/semicongine/vulkan/" | 141 mkDir "src/semicongine/vulkan/" |
| 157 cpFile "src/vulkan_api/output/api.nim", "src/semicongine/vulkan/api.nim" | 142 cpFile "src/vulkan_api/output/api.nim", "src/semicongine/vulkan/api.nim" |
| 158 cpDir "src/vulkan_api/output/platform", "src/semicongine/vulkan/platform" | 143 cpDir "src/vulkan_api/output/platform", "src/semicongine/vulkan/platform" |
| 159 | 144 |
| 160 if getCommand() in ["c", "compile", "r", "dump", "check", "idetools"]: | 145 if getCommand() in ["c", "compile", "r", "dump", "check", "idetools"]: |
