diff options
| author | Saikari <[email protected]> | 2026-01-31 13:49:14 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-01-31 13:49:35 +0300 |
| commit | 5db59f35d5770790d008d6fdc1c1bdea1f16d9b3 (patch) | |
| tree | efe5356f7b2127c3e9cae937d5f22c4b4da12213 | |
| parent | 5646519958738a45b448a264e1be81f305fed677 (diff) | |
refactor compile_commands policy to use generator namespace
| -rw-r--r-- | xmake/core/project/policy.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/project/clang/compile_commands.lua | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/project/policy.lua b/xmake/core/project/policy.lua index 51631e408..5123f0a5c 100644 --- a/xmake/core/project/policy.lua +++ b/xmake/core/project/policy.lua @@ -98,8 +98,6 @@ function policy.policies() -- Force C++ modules fallback dependency scanner for msvc ["build.c++.modules.msvc.fallbackscanner"] = {description = "Force msvc fallback module dependency scanner.", default = false, type = "boolean"}, ["build.c++.msvc.fallbackscanner"] = {description = "Force msvc fallback module dependency scanner. (deprecated)", default = false, type = "boolean"}, - -- Enable compile_commands - ["build.compile_commands"] = {description = "Enable compile_commands.", default = true, type = "boolean"}, -- Force C++ modules fallback dependency scanner for gcc ["build.c++.modules.gcc.fallbackscanner"] = {description = "Force gcc fallback module dependency scanner.", default = false, type = "boolean"}, ["build.c++.gcc.fallbackscanner"] = {description = "Force gcc fallback module dependency scanner. (deprecated)", default = false, type = "boolean"}, @@ -194,6 +192,8 @@ function policy.policies() ["network.mode"] = {description = "Set the network mode", type = "string"}, -- Set the compatibility version, e.g. 2.0, 3.0 ["compatibility.version"] = {description = "Set the compatibility version", type = "string", default = "3.0", values = {"2.0", "3.0"}}, + -- Enable compile_commands + ["generator.compile_commands"] = {description = "Enable compile_commands.", default = true, type = "boolean"}, -- Generate the solution file in root output directory -- @see https://github.com/xmake-io/xmake/issues/6519 ["generator.vsxmake.root_sln"] = {description = "Generate the solution file in root output directory", default = false, type = "boolean"} diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua index 28f4a876b..909184800 100644 --- a/xmake/plugins/project/clang/compile_commands.lua +++ b/xmake/plugins/project/clang/compile_commands.lua @@ -267,7 +267,7 @@ function _add_target(jsonfile, target) target:data_set("plugin.project.kind", "compile_commands") -- disable compile_commands? - if target:policy("build.compile_commands") == false then + if target:policy("generator.compile_commands") == false then return end |
