summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-11 14:11:59 +0800
committerruki <[email protected]>2015-06-11 14:12:05 +0800
commitf5b089a2170c000d4c0781eb08d6545894b14ab9 (patch)
treed4538abc9f5d2e54439ca11ab76cfd33bc5259cf /xmake/scripts/base/project.lua
parent2680c6575a238d0a199f2a31fcf47cd6d0687b62 (diff)
fix checking option bug for windows
Diffstat (limited to 'xmake/scripts/base/project.lua')
-rw-r--r--xmake/scripts/base/project.lua38
1 files changed, 23 insertions, 15 deletions
diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua
index d78bb7d5f..85972c066 100644
--- a/xmake/scripts/base/project.lua
+++ b/xmake/scripts/base/project.lua
@@ -406,6 +406,24 @@ function project._make_option(name, opt, cfile, cxxfile, objectfile, targetfile)
opt[k] = v
end
+ -- check links
+ if opt.links then
+ for _, link in ipairs(utils.wrap(opt.links)) do
+
+ -- only for compile a object file
+ local ok = compiler.check_include(opt, nil, cfile, objectfile)
+
+ -- check link
+ if ok then ok = linker.check_links(opt, link, objectfile, targetfile) end
+
+ -- trace
+ utils.verbose("checking for the link %s ... %s", link, utils.ifelse(ok, "ok", "no"))
+
+ -- failed
+ if not ok then return end
+ end
+ end
+
-- check includes and functions
if opt.cincludes or opt.cxxincludes then
@@ -440,6 +458,9 @@ function project._make_option(name, opt, cfile, cxxfile, objectfile, targetfile)
-- check function
local ok = compiler.check_function(opt, cfunc, cfile, objectfile)
+
+ -- check link
+ if ok and opt.links then ok = linker.check_links(opt, opt.links, objectfile, targetfile) end
-- trace
utils.verbose("checking for the c function %s ... %s", cfunc, utils.ifelse(ok, "ok", "no"))
@@ -454,23 +475,11 @@ function project._make_option(name, opt, cfile, cxxfile, objectfile, targetfile)
-- check function
local ok = compiler.check_function(opt, cxxfunc, cxxfile, objectfile)
- -- trace
- utils.verbose("checking for the c++ function %s ... %s", cxxfunc, utils.ifelse(ok, "ok", "no"))
-
- -- failed
- if not ok then return end
- end
- end
-
- -- check links
- if opt.links then
- for _, link in ipairs(utils.wrap(opt.links)) do
-
-- check link
- local ok = linker.check_link(opt, link, objectfile, targetfile)
+ if ok and opt.links then ok = linker.check_links(opt, opt.links, objectfile, targetfile) end
-- trace
- utils.verbose("checking for the link %s ... %s", link, utils.ifelse(ok, "ok", "no"))
+ utils.verbose("checking for the c++ function %s ... %s", cxxfunc, utils.ifelse(ok, "ok", "no"))
-- failed
if not ok then return end
@@ -582,7 +591,6 @@ function project._load_options(file)
, "cxflags"
, "cxxflags"
, "ldflags"
- , "shflags"
, "defines"
, "undefines"
, "defines_if_ok"