summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/compiler.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/scripts/base/compiler.lua')
-rw-r--r--xmake/scripts/base/compiler.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/xmake/scripts/base/compiler.lua b/xmake/scripts/base/compiler.lua
index bbf9a6106..e8f2508de 100644
--- a/xmake/scripts/base/compiler.lua
+++ b/xmake/scripts/base/compiler.lua
@@ -141,10 +141,31 @@ function compiler._addflags_from_platform(module, flags, flagnames)
-- check
assert(module and flags and flagnames)
- -- done
+ -- add flags
for _, flagname in ipairs(flagnames) do
table.join2(flags, compiler._mapflags(module, platform.get(flagname)))
end
+
+ -- add the includedirs flags
+ if module.flag_includedir then
+ for _, includedir in ipairs(utils.wrap(platform.get("includedirs"))) do
+ table.join2(flags, module:flag_includedir(includedir))
+ end
+ end
+
+ -- add the defines flags
+ if module.flag_define then
+ for _, define in ipairs(utils.wrap(platform.get("defines"))) do
+ table.join2(flags, module:flag_define(define))
+ end
+ end
+
+ -- append the undefines flags
+ if module.flag_undefine then
+ for _, undefine in ipairs(utils.wrap(platform.get("undefines"))) do
+ table.join2(flags, module:flag_undefine(undefine))
+ end
+ end
end
-- add flags from the target