Gildor's Forums

Author Topic: UE Viewer build 1368 - macOS support  (Read 469 times)
Gildor
Administrator
Hero Member
*****
Posts: 7827



View Profile WWW
UE Viewer build 1368 - macOS support
« on: August 02, 2020, 16:20 »

Well ... A long story.

I don't have a Mac. However I decided to try building UE Viewer for this platform. I've downloaded macOS Catalina (10.15) VMWare image and was able to launch gcc (clang wrapper) there. It took a lot of time to resolve errors - some of them weren't in code at all - e.g. compiler didn't want to pick the source code from virtual disk (Windows drive mapped to macOS file system) - it displayed errors like "source is not a valid UTF-8 file" in random places and absolutely VALID places. After a few hours of headbang, I've found a solution: I've copied source code from Windows drive to local macOS directory, then these terrible errors went away. Any change in the code (which I did in context of the Windows OS) had to be copied to macOS file system before compiling ...

As far as I don't have a "true" Mac, there's no hardware acceleration. Even simple screensavers do not run. Therefore, SDL library and OpenGL aren't running, so I wasn't able to try it. I've disabled "RENDERING" feature in source code in a hard way, so UModel executable works only as exporter. If there are programmers who have Mac, have macOS programming experience, understand UModel code base AND wants to help (yeah, a lot of requirements) - you're welcome to provide a pull request on Github.

Just to mention. At the moment I'm not going to provide UModel builds for macOS. However the building process should be very straightforward for anyone who knows how to download/unzip files and use console: get the source code from Github, make sure command line compiler is installed (macOS showed me the required command when I tried to run "gcc --version" for the first time), and type "./build.sh" like it is done for Linux. There will be 10-20 warnings during build process, because of more strict C++ language standard used in local compiler (there's NO warnings when building with latest Visual C++ or gcc!), then you'll get an executable, "umodel" (with no extension).

Good luck, and - any USEFUL feedback is welcome!
Logged
Blenux
Moderator
Hero Member
*****
Posts: 786


Welcome to Gildor Land.


View Profile
Re: UE Viewer build 1368 - macOS support
« Reply #1 on: August 02, 2020, 16:37 »

If no one is able to, I might be able to borrow a Mac off my cousin, (he owns a Phone Repair , but he is a Apple iPhone/Mac Junkie before anything else).
Logged

Blender User.
Rip Game Content to learn stuff.
Like to help people in general.
EvansMatthew97
Newbie
*
Posts: 1


View Profile
Re: UE Viewer build 1368 - macOS support
« Reply #2 on: September 02, 2020, 10:44 »

I have managed to compile on a MacBook Pro 16" running Catalina from the GitHub source without any issues. I'll be trying out the exporter CLI later today to check that everything works - just need to install some games to the laptop.

@Gildor Where is the rendering feature disabled so that I can try reenable it and start working on a PR?
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7827



View Profile WWW
Re: UE Viewer build 1368 - macOS support
« Reply #3 on: September 02, 2020, 10:56 »

Thanks.

It's disabled in UModelTool/Build.h
Code:
#ifdef __APPLE__
#undef RENDERING //todo?
#undef THREADING //todo?
#endif

Comment or remove #undef RENDERING there. You'll need to install SDL2 framework, and modify ./common.project, look for all "osx" appearances. I believe there should be a compiler parameter "--framework OpenGL --framework SDL2" etc, add it to "OPTIONS" parameter.
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS