summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/common.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-05 00:35:29 +0800
committerruki <[email protected]>2022-08-05 00:35:29 +0800
commita230a29949612a49fb9acb06988518e0d84ecfe1 (patch)
tree8b9d0df1baf153bab7bdbc05f235d61b19124a73 /xmake/rules/c++/modules/modules_support/common.lua
parent86dc716cbc9bf052012383f4448a069aa2a0bcb8 (diff)
add some comments
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/common.lua42
1 files changed, 30 insertions, 12 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua
index 7f6f7aa43..11f7bf897 100644
--- a/xmake/rules/c++/modules/modules_support/common.lua
+++ b/xmake/rules/c++/modules/modules_support/common.lua
@@ -267,18 +267,38 @@ function find_angle_header_file(target, file)
return p
end
-function fallback_generate_dependencies(target, jsonfile, sourcefile)
- local output = {
- version = 0,
- revision = 0,
- rules = {}
- }
-
- local rule = {
- outputs = {
- jsonfile
+-- https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html
+--[[
+{
+ "version": 1,
+ "revision": 0,
+ "rules": [
+ {
+ "primary-output": "use-header.mpp.o",
+ "requires": [
+ {
+ "logical-name": "<header.hpp>",
+ "source-path": "/path/to/found/header.hpp",
+ "unique-on-source-path": true,
+ "lookup-method": "include-angle"
+ }
+ ]
+ },
+ {
+ "primary-output": "header.hpp.bmi",
+ "provides": [
+ {
+ "logical-name": "header.hpp",
+ "source-path": "/path/to/found/header.hpp",
+ "unique-on-source-path": true,
}
+ ]
}
+ ]
+}]]
+function fallback_generate_dependencies(target, jsonfile, sourcefile)
+ local output = {version = 0, revision = 0, rules = {}}
+ local rule = {outputs = {jsonfile}}
rule["primary-output"] = target:objectfile(sourcefile)
local module_name
@@ -290,11 +310,9 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile)
if not module_name then
module_name = line:match("export%s+module%s+(.+)%s*;")
end
-
local module_depname = line:match("import%s+(.+)%s*;")
if module_depname then
local module_dep = {}
-
-- partition? import :xxx;
if module_depname:startswith(":") then
module_depname = module_name .. module_depname