diff options
| author | ruki <[email protected]> | 2022-08-29 22:57:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-29 22:57:06 +0800 |
| commit | 70fa2aa7e0fe6fd3aad44fabc8162f013a8cfa70 (patch) | |
| tree | 1e60b8502f6f6f7653f7dce2c5830dfc70311761 | |
| parent | 27baca74306f29e6ecb71975236437e804a9b697 (diff) | |
improve modules for clang
| -rw-r--r-- | tests/projects/c++/modules/hello/xmake.lua | 1 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/clang.lua | 3 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/msvc.lua | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/tests/projects/c++/modules/hello/xmake.lua b/tests/projects/c++/modules/hello/xmake.lua index 2315cf287..de13fc409 100644 --- a/tests/projects/c++/modules/hello/xmake.lua +++ b/tests/projects/c++/modules/hello/xmake.lua @@ -1,3 +1,4 @@ +add_rules("mode.release", "mode.debug") set_languages("c++20") target("hello") set_kind("binary") diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index ea11cbe1c..e67bacef1 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -48,7 +48,8 @@ function _add_module_to_mapper(target, name, bmifile, deps) end function _mapper_cachekey(target) - return target:name() .. "_modulemap" + local mode = config.mode() + return target:name() .. "_modulemap_" .. (mode or "") end -- flush modulemap to mapper file cache diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua index 4439a578e..7c17de0b7 100644 --- a/xmake/rules/c++/modules/modules_support/msvc.lua +++ b/xmake/rules/c++/modules/modules_support/msvc.lua @@ -45,7 +45,8 @@ function _add_module_to_mapper(target, argument, namekey, path, objectfile, bmif end function _mapper_cachekey(target) - return target:name() .. "_modulemap" + local mode = config.mode() + return target:name() .. "_modulemap_" .. (mode or "") end -- flush mapper file cache |
