summaryrefslogtreecommitdiff
path: root/xmake/scripts/platform
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/scripts/platform')
-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
8 files changed, 95 insertions, 82 deletions
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