summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
Diffstat (limited to 'xmake')
-rw-r--r--xmake/scripts/action/_global.lua4
-rw-r--r--xmake/scripts/action/action.lua4
-rw-r--r--xmake/scripts/base/utils.lua7
-rw-r--r--xmake/scripts/platform/android/prober.lua34
-rw-r--r--xmake/scripts/platform/iphoneos/prober.lua26
-rw-r--r--xmake/scripts/platform/iphonesimulator/prober.lua26
-rw-r--r--xmake/scripts/platform/linux/prober.lua20
-rw-r--r--xmake/scripts/platform/macosx/prober.lua24
-rw-r--r--xmake/scripts/platform/mingw/prober.lua20
-rw-r--r--xmake/scripts/platform/platform.lua7
-rw-r--r--xmake/scripts/platform/windows/prober.lua20
11 files changed, 106 insertions, 86 deletions
diff --git a/xmake/scripts/action/_global.lua b/xmake/scripts/action/_global.lua
index 53ed35b08..a8fffa0bc 100644
--- a/xmake/scripts/action/_global.lua
+++ b/xmake/scripts/action/_global.lua
@@ -45,7 +45,9 @@ end
function _global.done()
-- probe the global platform configure
- platform.probe(true)
+ if not platform.probe(true) then
+ return false
+ end
-- clear up the global configure
global.clearup()
diff --git a/xmake/scripts/action/action.lua b/xmake/scripts/action/action.lua
index f3f2a1ba8..1174b140a 100644
--- a/xmake/scripts/action/action.lua
+++ b/xmake/scripts/action/action.lua
@@ -103,7 +103,9 @@ function action.done(name)
-- probe the platform
if _action.need("platform") and (options._ACTION == "config" or config._RECONFIG) then
- platform.probe(false)
+ if not platform.probe(false) then
+ return false
+ end
end
-- merge the default options
diff --git a/xmake/scripts/base/utils.lua b/xmake/scripts/base/utils.lua
index 58ec6ba60..738013a76 100644
--- a/xmake/scripts/base/utils.lua
+++ b/xmake/scripts/base/utils.lua
@@ -224,10 +224,13 @@ function utils.call(funcs, pred, ...)
-- exists predicate?
if pred and type(pred) == "function" then
- if not pred(name, result) then break end
+ if not pred(name, result) then return false end
-- failed?
- elseif not result then break end
+ elseif not result then return false end
end
+
+ -- ok
+ return true
end
-- return module: utils
diff --git a/xmake/scripts/platform/android/prober.lua b/xmake/scripts/platform/android/prober.lua
index 6149b54fb..bb4abe023 100644
--- a/xmake/scripts/platform/android/prober.lua
+++ b/xmake/scripts/platform/android/prober.lua
@@ -205,6 +205,14 @@ function prober._probe_toolpath(configs, kind, cross, name, description)
utils.verbose("checking for %s (%s) ... no", description, kind)
end
+ -- failed?
+ if not toolpath and not configs.get("ndk") then
+ utils.error("checking for the NDK directory ... no")
+ utils.error(" - xmake config --ndk=xxx")
+ utils.error("or - xmake global --ndk=xxx")
+ return false
+ end
+
-- ok
return true
end
@@ -226,6 +234,8 @@ function prober._probe_toolchains(configs)
if not prober._probe_toolpath(configs, "ld", prefix, "g++", "the linker") then return false end
if not prober._probe_toolpath(configs, "ar", prefix, "ar", "the static library linker") then return false end
if not prober._probe_toolpath(configs, "sh", prefix, "g++", "the shared library linker") then return false end
+
+ -- ok
return true
end
@@ -233,13 +243,13 @@ end
function prober.config()
-- call all probe functions
- utils.call( { prober._probe_arch
- , prober._probe_make
- , prober._probe_ccache
- , prober._probe_ndk_sdkver
- , prober._probe_toolchains}
- , nil
- , config)
+ return utils.call( { prober._probe_arch
+ , prober._probe_make
+ , prober._probe_ccache
+ , prober._probe_ndk_sdkver
+ , prober._probe_toolchains}
+ , nil
+ , config)
end
@@ -247,11 +257,11 @@ end
function prober.global()
-- call all probe functions
- utils.call( { prober._probe_make
- , prober._probe_ccache
- , prober._probe_ndk_sdkver}
- , nil
- , global)
+ return utils.call( { prober._probe_make
+ , prober._probe_ccache
+ , prober._probe_ndk_sdkver}
+ , nil
+ , global)
end
-- return module: prober
diff --git a/xmake/scripts/platform/iphoneos/prober.lua b/xmake/scripts/platform/iphoneos/prober.lua
index 2c2892315..ae17a74c9 100644
--- a/xmake/scripts/platform/iphoneos/prober.lua
+++ b/xmake/scripts/platform/iphoneos/prober.lua
@@ -247,14 +247,14 @@ end
function prober.config()
-- call all probe functions
- utils.call( { prober._probe_arch
- , prober._probe_xcode
- , prober._probe_xcode_sdkver
- , prober._probe_make
- , prober._probe_ccache
- , prober._probe_toolchains}
- , nil
- , config)
+ return utils.call( { prober._probe_arch
+ , prober._probe_xcode
+ , prober._probe_xcode_sdkver
+ , prober._probe_make
+ , prober._probe_ccache
+ , prober._probe_toolchains}
+ , nil
+ , config)
end
@@ -262,11 +262,11 @@ end
function prober.global()
-- call all probe functions
- utils.call( { prober._probe_xcode
- , prober._probe_make
- , prober._probe_ccache}
- , nil
- , global)
+ return utils.call( { prober._probe_xcode
+ , prober._probe_make
+ , prober._probe_ccache}
+ , nil
+ , global)
end
-- return module: prober
diff --git a/xmake/scripts/platform/iphonesimulator/prober.lua b/xmake/scripts/platform/iphonesimulator/prober.lua
index e1002ec32..ae9754f81 100644
--- a/xmake/scripts/platform/iphonesimulator/prober.lua
+++ b/xmake/scripts/platform/iphonesimulator/prober.lua
@@ -246,25 +246,25 @@ end
function prober.config()
-- call all probe functions
- utils.call( { prober._probe_arch
- , prober._probe_xcode
- , prober._probe_xcode_sdkver
- , prober._probe_make
- , prober._probe_ccache
- , prober._probe_toolchains}
- , nil
- , config)
+ return utils.call( { prober._probe_arch
+ , prober._probe_xcode
+ , prober._probe_xcode_sdkver
+ , prober._probe_make
+ , prober._probe_ccache
+ , prober._probe_toolchains}
+ , nil
+ , config)
end
-- probe the global configure
function prober.global()
-- call all probe functions
- utils.call( { prober._probe_xcode
- , prober._probe_make
- , prober._probe_ccache}
- , nil
- , global)
+ return utils.call( { prober._probe_xcode
+ , prober._probe_make
+ , prober._probe_ccache}
+ , nil
+ , global)
end
-- return module: prober
diff --git a/xmake/scripts/platform/linux/prober.lua b/xmake/scripts/platform/linux/prober.lua
index ce23dadb5..5e5eec9b1 100644
--- a/xmake/scripts/platform/linux/prober.lua
+++ b/xmake/scripts/platform/linux/prober.lua
@@ -155,22 +155,22 @@ end
function prober.config()
-- call all probe functions
- utils.call( { prober._probe_arch
- , prober._probe_make
- , prober._probe_ccache
- , prober._probe_toolchains}
- , nil
- , config)
+ return utils.call( { prober._probe_arch
+ , prober._probe_make
+ , prober._probe_ccache
+ , prober._probe_toolchains}
+ , nil
+ , config)
end
-- probe the global configure
function prober.global()
-- call all probe functions
- utils.call( { prober._probe_make
- , prober._probe_ccache}
- , nil
- , global)
+ return utils.call( { prober._probe_make
+ , prober._probe_ccache}
+ , nil
+ , global)
end
-- return module: prober
diff --git a/xmake/scripts/platform/macosx/prober.lua b/xmake/scripts/platform/macosx/prober.lua
index 0e126f38c..d2c397edc 100644
--- a/xmake/scripts/platform/macosx/prober.lua
+++ b/xmake/scripts/platform/macosx/prober.lua
@@ -246,24 +246,24 @@ end
function prober.config()
-- call all probe functions
- utils.call( { prober._probe_arch
- , prober._probe_xcode
- , prober._probe_xcode_sdkver
- , prober._probe_make
- , prober._probe_ccache
- , prober._probe_toolchains}
- , nil
- , config)
+ return utils.call( { prober._probe_arch
+ , prober._probe_xcode
+ , prober._probe_xcode_sdkver
+ , prober._probe_make
+ , prober._probe_ccache
+ , prober._probe_toolchains}
+ , nil
+ , config)
end
-- probe the global configure
function prober.global()
-- call all probe functions
- utils.call( { prober._probe_xcode
- , prober._probe_ccache}
- , nil
- , global)
+ return utils.call( { prober._probe_xcode
+ , prober._probe_ccache}
+ , nil
+ , global)
end
-- return module: prober
diff --git a/xmake/scripts/platform/mingw/prober.lua b/xmake/scripts/platform/mingw/prober.lua
index 86fca46ab..0134c0509 100644
--- a/xmake/scripts/platform/mingw/prober.lua
+++ b/xmake/scripts/platform/mingw/prober.lua
@@ -168,22 +168,22 @@ end
function prober.config()
-- call all probe functions
- utils.call( { prober._probe_arch
- , prober._probe_make
- , prober._probe_ccache
- , prober._probe_toolchains}
- , nil
- , config)
+ return utils.call( { prober._probe_arch
+ , prober._probe_make
+ , prober._probe_ccache
+ , prober._probe_toolchains}
+ , nil
+ , config)
end
-- probe the global configure
function prober.global()
-- call all probe functions
- utils.call( { prober._probe_make
- , prober._probe_ccache}
- , nil
- , global)
+ return utils.call( { prober._probe_make
+ , prober._probe_ccache}
+ , nil
+ , global)
end
-- return module: prober
diff --git a/xmake/scripts/platform/platform.lua b/xmake/scripts/platform/platform.lua
index c2057e246..38d482f44 100644
--- a/xmake/scripts/platform/platform.lua
+++ b/xmake/scripts/platform/platform.lua
@@ -364,7 +364,7 @@ function platform.probe(is_global)
for _, plat in ipairs(plats) do
local module = platform._load(plat)
if module and module._PROBER and module._PROBER.global and module._HOST and module._HOST == xmake._HOST then
- module._PROBER.global()
+ if not module._PROBER.global() then return false end
end
end
@@ -373,9 +373,12 @@ function platform.probe(is_global)
-- probe it
local module = platform.module()
if module and module._PROBER and module._PROBER.config then
- module._PROBER.config()
+ if not module._PROBER.config() then return false end
end
end
+
+ -- ok
+ return true
end
-- return module: platform
diff --git a/xmake/scripts/platform/windows/prober.lua b/xmake/scripts/platform/windows/prober.lua
index f4aacf9d2..7c6f3a948 100644
--- a/xmake/scripts/platform/windows/prober.lua
+++ b/xmake/scripts/platform/windows/prober.lua
@@ -251,22 +251,22 @@ end
function prober.config()
-- call all probe functions
- utils.call( { prober._probe_arch
- , prober._probe_vs_version
- , prober._probe_vs_path
- , prober._probe_toolchains}
- , nil
- , config)
+ return utils.call( { prober._probe_arch
+ , prober._probe_vs_version
+ , prober._probe_vs_path
+ , prober._probe_toolchains}
+ , nil
+ , config)
end
-- probe the global configure
function prober.global()
-- call all probe functions
- utils.call( { prober._probe_vs_version
- , prober._probe_vs_path}
- , nil
- , global)
+ return utils.call( { prober._probe_vs_version
+ , prober._probe_vs_path}
+ , nil
+ , global)
end
-- return module: prober