From b089242de2da686afaa332131de38ca34f07c238 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Thu, 20 Jan 2022 10:29:55 +0100 Subject: 'xmake bundle' for Mac --- bundle.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'bundle.lua') diff --git a/bundle.lua b/bundle.lua index a7884ec76..50417f76d 100644 --- a/bundle.lua +++ b/bundle.lua @@ -110,7 +110,36 @@ local function main_windows() crashpad_handler_path) end +-------------------------------------------------------------------------------- +local function main_mac() + -- Build and universalify + _build("x86_64") + _build("arm64") + + os.mkdir("build/macosx/universal/release/") + local ret = _exec( + "lipo", + "-create", + "-output", "build/macosx/universal/release/zenserver", + "build/macosx/x86_64/release/zenserver", + "build/macosx/arm64/release/zenserver" + ) + if ret > 0 then + raise("Failed creating univeral binary") + end + + -- At the time of writing vcpkg does not support sentry-native on arm64. Once + -- it does we can create a univeral binary for this. For now just bundle x64 + local crashpad_handler_path = _find_vcpkg_binary( + "x64-osx", + "sentry-native", + "crashpad_handler") + -- Zip + _zip( + "build/zenserver-trace-macos.zip", + "build/macosx/universal/release/zenserver", + crashpad_handler_path) end -------------------------------------------------------------------------------- @@ -119,5 +148,9 @@ function main() return main_windows() end + if is_host("mac") then + return main_mac() + end + raise("'xmake bundle' not currently supported on this platform") end -- cgit v1.2.3