diff options
| author | Arthur LAURENT <[email protected]> | 2023-01-11 17:58:02 +0100 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2023-01-11 17:58:02 +0100 |
| commit | 8a582f9a9fb7be2cfbfdd2f18f31510547dff12b (patch) | |
| tree | b78c723874d355376c65faddf9c42181da5b39fe | |
| parent | 1175f07e0ead7a1f8a5d9cb76d895e1ea9b01ad0 (diff) | |
rename clang std modulemap policy
4 files changed, 7 insertions, 7 deletions
diff --git a/tests/projects/c++/modules/stdmodules/xmake.lua b/tests/projects/c++/modules/stdmodules/xmake.lua index 496961cd0..5cf4ccb9d 100644 --- a/tests/projects/c++/modules/stdmodules/xmake.lua +++ b/tests/projects/c++/modules/stdmodules/xmake.lua @@ -5,11 +5,11 @@ target("mod") set_kind("static") add_files("src/*.cpp", "src/*.mpp") - set_policy("c++.clang.module.stdmodules", true) + set_policy("build.c++.clang.stdmodules", true) target("stdmodules") set_kind("binary") add_files("test/*.cpp") add_deps("mod") - set_policy("c++.clang.module.stdmodules", true) + set_policy("build.c++.clang.stdmodules", true) diff --git a/tests/projects/c++/modules/stdmodules_multiple_targets/xmake.lua b/tests/projects/c++/modules/stdmodules_multiple_targets/xmake.lua index 3501597ff..32bed613b 100644 --- a/tests/projects/c++/modules/stdmodules_multiple_targets/xmake.lua +++ b/tests/projects/c++/modules/stdmodules_multiple_targets/xmake.lua @@ -5,10 +5,10 @@ target("mod") set_kind("static") add_files("src/*.cpp", "src/*.mpp") - set_policy("c++.clang.module.stdmodules", true) + set_policy("build.c++.clang.stdmodules", true) target("mod2") set_kind("static") add_files("src/*.cpp", "src/*.mpp") - set_policy("c++.clang.module.stdmodules", true) + set_policy("build.c++.clang.stdmodules", true) diff --git a/xmake/core/project/policy.lua b/xmake/core/project/policy.lua index 4c0d1a793..4c9f87cd1 100644 --- a/xmake/core/project/policy.lua +++ b/xmake/core/project/policy.lua @@ -35,8 +35,6 @@ function policy.policies() if not policies then policies = { - -- enable clang std modulemap - ["c++.clang.module.stdmodules"] = {description = "Enable clang std modulemap.", default = false, type = "boolean"}, -- we will check and ignore all unsupported flags by default, but we can also pass `{force = true}` to force to set flags, e.g. add_ldflags("-static", {force = true}) ["check.auto_ignore_flags"] = {description = "Enable check and ignore unsupported flags automatically.", default = true, type = "boolean"}, -- we will map gcc flags to the current compiler and linker by default. @@ -55,6 +53,8 @@ function policy.policies() ["build.optimization.lto"] = {description = "Enable LTO linker-time optimization for c/c++ building.", type = "boolean"}, -- enable C++ modules for C++ building, even if no .mpp is involved in the compilation ["build.c++.modules"] = {description = "Enable C++ modules for C++ building.", type = "boolean"}, + -- enable clang std modulemap + ["build.c++.clang.stdmodules"] = {description = "Enable clang std modulemap.", default = false, type = "boolean"}, -- preprocessor configuration for ccache/distcc, we can disable linemarkers to speed up preprocess ["preprocessor.linemarkers"] = {description = "Enable linemarkers for preprocessor.", default = true, type = "boolean"}, -- preprocessor configuration for ccache/distcc, we can disable it to avoid cache object file with __DATE__, __TIME__ diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index 747c62166..30b27bc2a 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -84,7 +84,7 @@ function load(target) target:add("cxxflags", modulestsflag) end - if target:policy("c++.clang.module.stdmodules") then + if target:policy("build.c++.clang.stdmodules") then target:add("cxxflags", builtinmodulemapflag, {force = true}) target:add("cxxflags", implicitmodulesflag, {force = true}) else |
