@@ -14,25 +14,19 @@ function _get_aui_package(target)
1414 return nil
1515end
1616
17- -- Locate aui.toolbox binary. Checks the aui package bin dir first, then the
18- -- aui-toolbox package (needed on macOS where the cmake build omits the binary),
19- -- and finally falls back to PATH.
20- function _find_toolbox ( aui_installdir , target )
17+ -- Locate aui.toolbox binary. On macOS the AUI cmake build wraps every
18+ -- executable in a MACOSX_BUNDLE, so the binary lives inside an .app bundle.
19+ function _find_toolbox ( aui_installdir )
20+ -- Linux / Windows
2121 local p = path .join (aui_installdir , " bin" , " aui.toolbox" )
2222 if os .isfile (p ) then return p end
2323
2424 p = path .join (aui_installdir , " bin" , " aui.toolbox.exe" )
2525 if os .isfile (p ) then return p end
2626
27- -- aui-toolbox is a separate package that builds the toolbox via xmake;
28- -- required as a fallback when the aui cmake build does not install it.
29- for _ , pkg in pairs (target :pkgs ()) do
30- if pkg :name () == " aui-toolbox" then
31- local suffix = is_host (" windows" ) and " .exe" or " "
32- p = path .join (pkg :installdir (), " bin" , " aui.toolbox" .. suffix )
33- if os .isfile (p ) then return p end
34- end
35- end
27+ -- macOS: cmake installs the .app bundle, so the real binary is inside it
28+ p = path .join (aui_installdir , " bin" , " aui.toolbox.app" , " Contents" , " MacOS" , " aui.toolbox" )
29+ if os .isfile (p ) then return p end
3630
3731 return find_program (" aui.toolbox" )
3832end
@@ -56,11 +50,9 @@ function assets(target)
5650 local aui_installdir = aui_pkg :installdir ()
5751 wprint (" AUI package install directory: " .. aui_installdir )
5852
59- local toolbox_path = _find_toolbox (aui_installdir , target )
53+ local toolbox_path = _find_toolbox (aui_installdir )
6054 if not toolbox_path then
61- raise (" aui.toolbox not found. Checked: "
62- .. aui_installdir .. " /bin/, the aui-toolbox package, and PATH. "
63- .. " Ensure add_requires('aui-toolbox 7.1.2') is in xmake.lua." )
55+ raise (" aui.toolbox not found. Checked bin/, bin/aui.toolbox.app/Contents/MacOS/, and PATH under " .. aui_installdir )
6456 end
6557
6658 local assets_dir = path .join (path .absolute (target :scriptdir ()), " assets" )
0 commit comments