From f4ccb1825049d7ec8f0df5e333cce7e7fd86cca7 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Apr 2024 00:25:31 +0800 Subject: improve bcsave --- xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua b/xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua index 3f88155cc..a23523b4d 100644 --- a/xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua +++ b/xmake/core/sandbox/modules/import/lib/luajit/bcsave.lua @@ -23,6 +23,10 @@ local io = require("base/io") local string = require("base/string") local raise = require("sandbox/modules/raise") +if not xmake._LUAJIT then + return +end + -- save lua file to bitcode file -- -- @param luafile the lua file @@ -45,6 +49,4 @@ function main(luafile, bcfile, opt) end end -if xmake._LUAJIT then - return main -end +return main -- cgit v1.3.1 From 539785cee40ea366af0128f5e6ca0b1a8a622855 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Apr 2024 00:26:07 +0800 Subject: ignore xmake.lua for apis --- xmake/plugins/show/lists/apis.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/plugins/show/lists/apis.lua b/xmake/plugins/show/lists/apis.lua index 7e481b206..f42f4b839 100644 --- a/xmake/plugins/show/lists/apis.lua +++ b/xmake/plugins/show/lists/apis.lua @@ -275,7 +275,7 @@ function script_extension_module_apis() local moduledirs = module.directories() for _, moduledir in ipairs(moduledirs) do moduledir = path.absolute(moduledir) - local modulefiles = os.files(path.join(moduledir, "**.lua|xmake.lua|private/**.lua|core/tools/**.lua|detect/tools/**.lua")) + local modulefiles = os.files(path.join(moduledir, "**.lua|**/xmake.lua|private/**.lua|core/tools/**.lua|detect/tools/**.lua")) if modulefiles then for _, modulefile in ipairs(modulefiles) do local modulename = path.relative(modulefile, moduledir) -- cgit v1.3.1 From cf42445dd5dce09224ee1bfa28f2925ce50d7eeb Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Apr 2024 00:28:45 +0800 Subject: improve modulename --- xmake/plugins/show/lists/apis.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/plugins/show/lists/apis.lua b/xmake/plugins/show/lists/apis.lua index f42f4b839..6e74bb6a8 100644 --- a/xmake/plugins/show/lists/apis.lua +++ b/xmake/plugins/show/lists/apis.lua @@ -282,7 +282,7 @@ function script_extension_module_apis() if path.filename(modulename) == "main.lua" then modulename = path.directory(modulename) end - modulename = modulename:gsub("/", "."):gsub("%.lua", "") + modulename = modulename:gsub("[\\/]", "."):gsub("%.lua", "") local instance = import(modulename, {try = true, anonymous = true}) if instance then if _is_callable(instance) then -- cgit v1.3.1 From f75bba94279da494cbc84a0877af2ee6a1576a03 Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 27 Apr 2024 09:00:38 +0800 Subject: Update find_mingw.lua --- xmake/modules/detect/sdks/find_mingw.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index 69b6a1df9..cdfef677c 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -28,13 +28,14 @@ import("detect.sdks.find_cross_toolchain") -- find mingw directory function _find_mingwdir(sdkdir) - + cprint("_find_mingwdir #1 %s", sdkdir) -- get mingw directory if not sdkdir then if is_host("macosx", "linux") and os.isdir("/opt/llvm-mingw") then sdkdir = "/opt/llvm-mingw" elseif is_host("macosx") and os.isdir("/usr/local/opt/mingw-w64") then sdkdir = "/usr/local/opt/mingw-w64" + cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("linux") then sdkdir = "/usr" elseif is_subhost("msys") then @@ -78,6 +79,7 @@ function _find_mingw(sdkdir, bindir, cross) -- find mingw root directory sdkdir = _find_mingwdir(sdkdir) + cprint("_find_mingw #1 %s", sdkdir) if not sdkdir then return end -- cgit v1.3.1 From 4989b6b9fa31e5235e7bf7a318a4bc32952289ea Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 27 Apr 2024 10:36:55 +0800 Subject: Update find_mingw.lua --- xmake/modules/detect/sdks/find_mingw.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index cdfef677c..cd4c7e85f 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -36,6 +36,9 @@ function _find_mingwdir(sdkdir) elseif is_host("macosx") and os.isdir("/usr/local/opt/mingw-w64") then sdkdir = "/usr/local/opt/mingw-w64" cprint("_find_mingwdir #2 %s", sdkdir) + elseif is_host("macosx") and os.isdir("/opt/homebrew/Cellar/mingw-w64") then + sdkdir = "/opt/homebrew/Cellar/mingw-w64" + cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("linux") then sdkdir = "/usr" elseif is_subhost("msys") then -- cgit v1.3.1 From 16684a7aef604c1dbf26a9d8d704d6ae57cbd82d Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 27 Apr 2024 11:15:47 +0800 Subject: Update find_mingw.lua --- xmake/modules/detect/sdks/find_mingw.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index cd4c7e85f..1cd2c7e0d 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -37,7 +37,7 @@ function _find_mingwdir(sdkdir) sdkdir = "/usr/local/opt/mingw-w64" cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("macosx") and os.isdir("/opt/homebrew/Cellar/mingw-w64") then - sdkdir = "/opt/homebrew/Cellar/mingw-w64" + sdkdir = string.sub(find_directory("bin", "/opt/homebrew/Cellar/mingw-w64"), 1, -5) cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("linux") then sdkdir = "/usr" -- cgit v1.3.1 From 7e2d8f87d4e1ea137d29ad264caae50ea8968d59 Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 27 Apr 2024 11:21:00 +0800 Subject: Update find_mingw.lua --- xmake/modules/detect/sdks/find_mingw.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index 1cd2c7e0d..1959c632d 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -37,7 +37,7 @@ function _find_mingwdir(sdkdir) sdkdir = "/usr/local/opt/mingw-w64" cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("macosx") and os.isdir("/opt/homebrew/Cellar/mingw-w64") then - sdkdir = string.sub(find_directory("bin", "/opt/homebrew/Cellar/mingw-w64"), 1, -5) + sdkdir = string.sub(find_path("bin", "/opt/homebrew/Cellar/mingw-w64"), 1, -5) cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("linux") then sdkdir = "/usr" -- cgit v1.3.1 From e80ed6f4ca41149382d24d2be1706ea5705b5e42 Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 27 Apr 2024 11:25:08 +0800 Subject: Update find_mingw.lua --- xmake/modules/detect/sdks/find_mingw.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index 1959c632d..fd03b2fc0 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -20,6 +20,7 @@ -- imports import("lib.detect.find_path") +import("lib.detect.find_directory") import("core.base.option") import("core.base.global") import("core.project.config") @@ -37,7 +38,7 @@ function _find_mingwdir(sdkdir) sdkdir = "/usr/local/opt/mingw-w64" cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("macosx") and os.isdir("/opt/homebrew/Cellar/mingw-w64") then - sdkdir = string.sub(find_path("bin", "/opt/homebrew/Cellar/mingw-w64"), 1, -5) + sdkdir = string.sub(find_directory("bin", "/opt/homebrew/Cellar/mingw-w64"), 1, -5) cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("linux") then sdkdir = "/usr" -- cgit v1.3.1 From 57a632aa1501799d5f199a2cf06e27b28ae686b1 Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 27 Apr 2024 11:33:38 +0800 Subject: Update find_mingw.lua --- xmake/modules/detect/sdks/find_mingw.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index fd03b2fc0..b5eca3d5d 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -20,7 +20,6 @@ -- imports import("lib.detect.find_path") -import("lib.detect.find_directory") import("core.base.option") import("core.base.global") import("core.project.config") @@ -37,8 +36,8 @@ function _find_mingwdir(sdkdir) elseif is_host("macosx") and os.isdir("/usr/local/opt/mingw-w64") then sdkdir = "/usr/local/opt/mingw-w64" cprint("_find_mingwdir #2 %s", sdkdir) - elseif is_host("macosx") and os.isdir("/opt/homebrew/Cellar/mingw-w64") then - sdkdir = string.sub(find_directory("bin", "/opt/homebrew/Cellar/mingw-w64"), 1, -5) + elseif is_host("macosx") and os.isdir("/opt/homebrew/opt/mingw-w64") then + sdkdir = "/opt/homebrew/opt/mingw-w64" cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("linux") then sdkdir = "/usr" -- cgit v1.3.1 From eeeb76b2d14cd942302231bdcdde04dc39cf9928 Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 27 Apr 2024 11:40:13 +0800 Subject: Update find_mingw.lua --- xmake/modules/detect/sdks/find_mingw.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index b5eca3d5d..9a1f24253 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -28,17 +28,16 @@ import("detect.sdks.find_cross_toolchain") -- find mingw directory function _find_mingwdir(sdkdir) - cprint("_find_mingwdir #1 %s", sdkdir) -- get mingw directory if not sdkdir then if is_host("macosx", "linux") and os.isdir("/opt/llvm-mingw") then sdkdir = "/opt/llvm-mingw" elseif is_host("macosx") and os.isdir("/usr/local/opt/mingw-w64") then + -- for macOS Intel sdkdir = "/usr/local/opt/mingw-w64" - cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("macosx") and os.isdir("/opt/homebrew/opt/mingw-w64") then + -- for Apple Silicon sdkdir = "/opt/homebrew/opt/mingw-w64" - cprint("_find_mingwdir #2 %s", sdkdir) elseif is_host("linux") then sdkdir = "/usr" elseif is_subhost("msys") then @@ -82,7 +81,6 @@ function _find_mingw(sdkdir, bindir, cross) -- find mingw root directory sdkdir = _find_mingwdir(sdkdir) - cprint("_find_mingw #1 %s", sdkdir) if not sdkdir then return end -- cgit v1.3.1 From dcfffe48969339ee4263e69c22a5d1de60fc824b Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 27 Apr 2024 11:41:31 +0800 Subject: Update find_mingw.lua --- xmake/modules/detect/sdks/find_mingw.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/xmake/modules/detect/sdks/find_mingw.lua b/xmake/modules/detect/sdks/find_mingw.lua index 9a1f24253..4085a6cb8 100644 --- a/xmake/modules/detect/sdks/find_mingw.lua +++ b/xmake/modules/detect/sdks/find_mingw.lua @@ -28,6 +28,7 @@ import("detect.sdks.find_cross_toolchain") -- find mingw directory function _find_mingwdir(sdkdir) + -- get mingw directory if not sdkdir then if is_host("macosx", "linux") and os.isdir("/opt/llvm-mingw") then -- cgit v1.3.1