MacOS build instructions are building unopenable file
I followed your intructions in Readme file, but when I try to open the built file, it crashes immediately.
App openxcom quit unexpectedly. Ignore / Report
Using MacBook Pro 14" with M1 PRO chip.
Any advise how to build it properly?
Are you having the same issue as this?
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: openxcom [92962]
Path: /Users/USER/*/openxcom.app/Contents/MacOS/openxcom
Identifier: SupSuper.openxcom
Version: 1.0 ()
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2022-10-24 20:54:29.8105 +0100
OS Version: macOS 12.6 (21G115)
Report Version: 12
Anonymous UUID: 96F98092-B2F5-562A-B704-E0AAD71B0E25
Sleep/Wake UUID: 7DCC4289-FCAE-4406-B4FE-B0D3E586FA5D
Time Awake Since Boot: 280000 seconds
Time Since Wake: 924 seconds
System Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes: UNKNOWN_0x32 at 0x0000000107408000
Exception Codes: 0x0000000000000032, 0x0000000107408000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 2
I got past this stage by running
codesign --force --deep --sign - build/openxcom.app
I'd like to get to the bottom of why I need to sign it, but I now have another problem: Failed loading SDL2 library
I think modern macOS versions require all executables to be signed (either a temporary developer signature or a permanent paid signature). Would be nice if it showed an error instead of a crash though.
Do these builds work for you: https://macsourceports.com/game/xcomufo Might be worth asking how they did it.
I'd like to get to the bottom of why I need to sign it, but I now have another problem: Failed loading SDL2 library
Are you using the original SDL1.2 or sdl12-compat? sdl12-compat requires SDL2, as it's just a compatibility shim.
I got past this stage by running
codesign --force --deep --sign - build/openxcom.appI'd like to get to the bottom of why I need to sign it, but I now have another problem: Failed loading SDL2 library
In order to fix this issue you should install SDL2 lib. Here is a video how to setup SDL2 on macos.
@avandriets I have SDL2 installed, both the framework under /Library/Frameworks as suggested in the video, and via brew. For some reason the framework however is not bundled in the executable and sdl2 isn't linked. I've been debugging CMakeLists but haven't made much progress. The app runs with the SDL2 framework installed. The app does boot after following the instructions in the video, but I want a clean build that runs outside of my environment.
@SupSuper I may get in touch with them actually. I'm using sdl12-compat, yes.