diff options
| author | Christian Rendina <[email protected]> | 2025-04-10 09:50:37 +0200 |
|---|---|---|
| committer | Christian Rendina <[email protected]> | 2025-04-10 09:50:37 +0200 |
| commit | 78723913d76fb8b615df34541236b8ea588d30db (patch) | |
| tree | b6b6ff550e4a2f73d94c63a61876cec31a4b3ae3 /xmake/rules/utils | |
| parent | 2051c13f735a626f7b6fd8b98aa69f01fd9cef7e (diff) | |
| parent | fd49b7754c6709a87b5beb5526788bbc1a663965 (diff) | |
Merge branch 'dev' of https://github.com/xmake-io/xmake into dev
Diffstat (limited to 'xmake/rules/utils')
| -rw-r--r-- | xmake/rules/utils/bin2c/xmake.lua | 3 | ||||
| -rw-r--r-- | xmake/rules/utils/compiler_runtime/xmake.lua | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/xmake/rules/utils/bin2c/xmake.lua b/xmake/rules/utils/bin2c/xmake.lua index 5d0dbfd31..392b2f20a 100644 --- a/xmake/rules/utils/bin2c/xmake.lua +++ b/xmake/rules/utils/bin2c/xmake.lua @@ -20,6 +20,7 @@ rule("utils.bin2c") set_extensions(".bin") + add_orders("utils.bin2c", "c++.build.modules.builder") on_load(function (target) local headerdir = path.join(target:autogendir(), "rules", "utils", "bin2c") if not os.isdir(headerdir) then @@ -27,7 +28,7 @@ rule("utils.bin2c") end target:add("includedirs", headerdir) end) - before_buildcmd_file(function (target, batchcmds, sourcefile_bin, opt) + on_preparecmd_file(function (target, batchcmds, sourcefile_bin, opt) -- get header file local headerdir = path.join(target:autogendir(), "rules", "utils", "bin2c") diff --git a/xmake/rules/utils/compiler_runtime/xmake.lua b/xmake/rules/utils/compiler_runtime/xmake.lua index 1a50fddef..cd8d5297c 100644 --- a/xmake/rules/utils/compiler_runtime/xmake.lua +++ b/xmake/rules/utils/compiler_runtime/xmake.lua @@ -40,5 +40,16 @@ rule("utils.compiler.runtime") end target:set("runtimes", runtimes) end + + -- enable vs runtime as MD by default + if target:is_plat("windows") and not target:get("runtimes") then + local vs_runtime_default = target:policy("build.c++.msvc.runtime") + if vs_runtime_default and target:has_tool("cxx", "cl", "clang_cl") then + if is_mode("debug") then + vs_runtime_default = vs_runtime_default .. "d" + end + target:set("runtimes", vs_runtime_default) + end + end end) |
