Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS ARM support <3 #147

Open
wants to merge 107 commits into
base: master
Choose a base branch
from
Open

MacOS ARM support <3 #147

wants to merge 107 commits into from

Conversation

enzofrnt
Copy link

@enzofrnt enzofrnt commented Nov 8, 2024

Here is the support for MacOS on ARM64 using crossover (proton like but on Mac) <3

This pull request introduces support for building and running the project on macOS, alongside existing support for Windows and Linux. The changes include updates to the build configuration, source code modifications to handle macOS-specific functionality, and additional code to support macOS-specific paths and libraries.

Build Configuration:

  • Added a new GitHub Actions workflow for building the project on macOS using CMake. (.github/workflows/cmake-macos.yml)
  • Updated CMakeLists.txt to include macOS-specific build configurations and dependencies. [1] [2]

Source Code Modifications:

  • Updated various source files to include macOS-specific preprocessor directives and handle macOS-specific paths and libraries. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Added macOS-specific implementations for functions in GameStart.cpp to handle game initialization and execution. [1] [2] [3]

Header File Updates:

  • Updated Options.h to include macOS in the platform-specific executable name definition.
  • Added macOS-specific function declarations in Security/Init.h.
  • Included additional headers and macOS-specific code in vdf_parser.hpp. [1] [2]

Additional Functionality:

  • Implemented macOS-specific functions for handling file paths and validating game installations in BeamNG.cpp. [1] [2] [3]

```bash
Book • ➜  ~/GithubRepo/BeamMP-Launcher git:(ghcw-session-d22d) ✗ cmake --build . --config $BUILD_TYPE
[  5%] Building CXX object CMakeFiles/Launcher.dir/src/GameStart.cpp.o
In file included from /Users/enzofournet/GithubRepo/BeamMP-Launcher/src/GameStart.cpp:13:
/Users/enzofournet/GithubRepo/BeamMP-Launcher/include/vdf_parser.hpp:134:43: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  134 |                 std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
      |                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /Users/enzofournet/GithubRepo/BeamMP-Launcher/src/GameStart.cpp:13:
/Users/enzofournet/GithubRepo/BeamMP-Launcher/include/vdf_parser.hpp:134:22: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  134 |                 std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
      |                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
2 warnings generated.
[ 11%] Building CXX object CMakeFiles/Launcher.dir/src/Security/BeamNG.cpp.o
In file included from /Users/enzofournet/GithubRepo/BeamMP-Launcher/src/Security/BeamNG.cpp:13:
/Users/enzofournet/GithubRepo/BeamMP-Launcher/include/vdf_parser.hpp:134:43: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  134 |                 std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
      |                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /Users/enzofournet/GithubRepo/BeamMP-Launcher/src/Security/BeamNG.cpp:13:
/Users/enzofournet/GithubRepo/BeamMP-Launcher/include/vdf_parser.hpp:134:22: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  134 |                 std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
      |                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
2 warnings generated.
[ 17%] Linking CXX executable BeamMP-Launcher
ld: warning: ignoring duplicate libraries: 'vcpkg_installed/arm64-osx/lib/libz.a'
[100%] Built target Launcher
Book • ➜  ~/GithubRepo/BeamMP-Launcher git:(ghcw-session-d22d) ✗ Book • ➜  ~/GithubRepo/BeamMP-Launcher git:(ghcw-session-d22d) ✗ cmake --build . --config $BUILD_TYPE
[  5%] Building CXX object CMakeFiles/Launcher.dir/src/GameStart.cpp.o
In file included from /Users/enzofournet/GithubRepo/BeamMP-Launcher/src/GameStart.cpp:13:
/Users/enzofournet/GithubRepo/BeamMP-Launcher/include/vdf_parser.hpp:134:43: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  134 |                 std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
      |                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /Users/enzofournet/GithubRepo/BeamMP-Launcher/src/GameStart.cpp:13:
/Users/enzofournet/GithubRepo/BeamMP-Launcher/include/vdf_parser.hpp:134:22: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  134 |                 std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
      |                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
2 warnings generated.
[ 11%] Building CXX object CMakeFiles/Launcher.dir/src/Security/BeamNG.cpp.o
In file included from /Users/enzofournet/GithubRepo/BeamMP-Launcher/src/Security/BeamNG.cpp:13:
/Users/enzofournet/GithubRepo/BeamMP-Launcher/include/vdf_parser.hpp:134:43: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
  134 |                 std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
      |                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /Users/enzofournet/GithubRepo/BeamMP-Launcher/src/Security/BeamNG.cpp:13:
/Users/enzofournet/GithubRepo/BeamMP-Launcher/include/vdf_parser.hpp:134:22: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
  134 |                 std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
      |                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
2 warnings generated.
[ 17%] Linking CXX executable BeamMP-Launcher
ld: warning: ignoring duplicate libraries: 'vcpkg_installed/arm64-osx/lib/libz.a'
[100%] Built target Launcher
Book • ➜  ~/GithubRepo/BeamMP-Launcher git:(ghcw-session-d22d) ✗
```
@enzofrnt
Copy link
Author

@WiserTixx done !

src/Options.cpp Outdated Show resolved Hide resolved
src/Security/BeamNG.cpp Outdated Show resolved Hide resolved
src/Security/BeamNG.cpp Outdated Show resolved Hide resolved
src/Security/BeamNG.cpp Outdated Show resolved Hide resolved
src/Security/BeamNG.cpp Outdated Show resolved Hide resolved
src/Security/BeamNG.cpp Outdated Show resolved Hide resolved
src/Security/BeamNG.cpp Outdated Show resolved Hide resolved
@enzofrnt
Copy link
Author

@WiserTixx finished

@enzofrnt
Copy link
Author

@WiserTixx done !

src/Security/BeamNG.cpp Outdated Show resolved Hide resolved
src/Security/BeamNG.cpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for MacOS using CrossOver Add support for MacOS Wine - Especially for CrossOver
4 participants