From 5dbb7213dae2568a85bd4cbc7fcfeefc8a908fc9 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 12 Jun 2015 13:19:19 +0800 Subject: add linkdirs and includedirs for platform --- xmake/scripts/base/compiler.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'xmake/scripts/base/compiler.lua') 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 -- cgit v1.3.1