mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-11 21:17:44 +00:00
[compat] fix solaris build and update instructions for CPM on solaris (#270)
Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/270 Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
5180031313
commit
bf7f3e25fc
8 changed files with 49 additions and 79 deletions
|
@ -21,6 +21,12 @@ if (PLATFORM_SUN)
|
||||||
# Terrific Solaris pkg shenanigans
|
# Terrific Solaris pkg shenanigans
|
||||||
list(APPEND CMAKE_PREFIX_PATH "/usr/lib/qt/6.6/lib/amd64/cmake")
|
list(APPEND CMAKE_PREFIX_PATH "/usr/lib/qt/6.6/lib/amd64/cmake")
|
||||||
list(APPEND CMAKE_MODULE_PATH "/usr/lib/qt/6.6/lib/amd64/cmake")
|
list(APPEND CMAKE_MODULE_PATH "/usr/lib/qt/6.6/lib/amd64/cmake")
|
||||||
|
# For some mighty reason, doing a normal release build sometimes may not trigger
|
||||||
|
# the proper -O3 switch to materialize
|
||||||
|
if (CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm)
|
set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm)
|
||||||
|
|
|
@ -7,6 +7,16 @@
|
||||||
* **FreeBSD**: [FreeBSD Building Guide](./docs/build/FreeBSD.md)
|
* **FreeBSD**: [FreeBSD Building Guide](./docs/build/FreeBSD.md)
|
||||||
* **macOS**: [macOS Building Guide](./docs/build/macOS.md)
|
* **macOS**: [macOS Building Guide](./docs/build/macOS.md)
|
||||||
|
|
||||||
|
# CPM
|
||||||
|
|
||||||
|
CPM (CMake Package Manager) is the preferred method of managing dependencies within Eden. Documentation on adding dependencies/using CPMUtil is in the works.
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
- `YUZU_USE_CPM` is set by default on MSVC and Android. Other platforms should use this if certain "required" system dependencies (e.g. OpenSSL) are broken or missing
|
||||||
|
- `CPMUTIL_DEFAULT_SYSTEM` can be set to `OFF` to force the usage of bundled dependencies. This can marginally decrease the final package size.
|
||||||
|
- When adding new prebuilt dependencies a la OpenSSL, SDL2, or FFmpeg, there *must* be a CMake option made available to forcefully download this bundle. See the OpenSSL implementation in the root CMakeLists for an example.
|
||||||
|
* This is necessary to allow for creation of fully-qualified source packs that allow for offline builds after download (some package managers and distros enforce this)
|
||||||
|
|
||||||
# Guidelines
|
# Guidelines
|
||||||
|
|
||||||
## License Headers
|
## License Headers
|
||||||
|
@ -76,9 +86,16 @@ cmake --build /tmp/ramdisk -- -j32
|
||||||
sudo umount /tmp/ramdisk
|
sudo umount /tmp/ramdisk
|
||||||
```
|
```
|
||||||
|
|
||||||
# How to test JIT
|
## Debugging (host code)
|
||||||
|
|
||||||
## gdb
|
Ignoring SIGSEGV when debugging in host:
|
||||||
|
|
||||||
|
- **gdb**: `handle all nostop pass`.
|
||||||
|
- **lldb**: `pro hand -p true -s false -n false SIGSEGV`.
|
||||||
|
|
||||||
|
## Debugging (guest code)
|
||||||
|
|
||||||
|
### gdb
|
||||||
|
|
||||||
Run `./build/bin/eden-cli -c <path to your config file (see logs where you run eden normally to see where it is)> -d -g <path to game>`
|
Run `./build/bin/eden-cli -c <path to your config file (see logs where you run eden normally to see where it is)> -d -g <path to game>`
|
||||||
|
|
||||||
|
@ -110,7 +127,7 @@ Expressions can be `variable_names` or `1234` (numbers) or `*var` (dereference o
|
||||||
|
|
||||||
For more information type `info gdb` and read [the man page](https://man7.org/linux/man-pages/man1/gdb.1.html).
|
For more information type `info gdb` and read [the man page](https://man7.org/linux/man-pages/man1/gdb.1.html).
|
||||||
|
|
||||||
## Bisecting older commits
|
# Bisecting older commits
|
||||||
|
|
||||||
Since going into the past can be tricky (especially due to the dependencies from the project being lost thru time). This should "restore" the URLs for the respective submodules.
|
Since going into the past can be tricky (especially due to the dependencies from the project being lost thru time). This should "restore" the URLs for the respective submodules.
|
||||||
|
|
||||||
|
|
12
docs/build/FreeBSD.md
vendored
12
docs/build/FreeBSD.md
vendored
|
@ -1,12 +1,13 @@
|
||||||
## One word of caution before proceeding.
|
## One word of caution before proceeding.
|
||||||
|
|
||||||
This is not the usual or preferred way to build programs on FreeBSD.
|
This is not the usual or preferred way to build programs on FreeBSD.
|
||||||
As of writing there is no official fresh port available for eden-emu, but it is in the works.
|
As of writing there is no official fresh port available for Eden, but it is in the works.
|
||||||
After it is available you can find a link to the eden-emu fresh port here and on Escarys github repo.
|
After it is available you can find a link to the eden-emu fresh port here and on Escary's github repo.
|
||||||
See this build as an AppImage alternative for FreeBSD.
|
See this build as an AppImage alternative for FreeBSD.
|
||||||
|
|
||||||
## Dependencies.
|
## Dependencies.
|
||||||
Before we start we need some dependencies.
|
Before we start we need some dependencies.
|
||||||
These dependencies are generally needed to build eden-emu on FreeBSD.
|
These dependencies are generally needed to build Eden on FreeBSD.
|
||||||
|
|
||||||
```
|
```
|
||||||
devel/cmake
|
devel/cmake
|
||||||
|
@ -56,8 +57,6 @@ Change into that build directory:
|
||||||
cd build
|
cd build
|
||||||
```
|
```
|
||||||
|
|
||||||
Now choose one option either 1 or 2, but not both as one option overwrites the other.
|
|
||||||
|
|
||||||
#### 1. Building in Release Mode (usually preferred and the most performant choice):
|
#### 1. Building in Release Mode (usually preferred and the most performant choice):
|
||||||
```sh
|
```sh
|
||||||
cmake .. -GNinja -DYUZU_TESTS=OFF
|
cmake .. -GNinja -DYUZU_TESTS=OFF
|
||||||
|
@ -81,3 +80,6 @@ OR
|
||||||
```sh
|
```sh
|
||||||
doas -- ninja install
|
doas -- ninja install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OpenSSL
|
||||||
|
The available OpenSSL port (3.0.17) is out-of-date, and using a bundled static library instead is recommended; to do so, add `-DYUZU_USE_CPM=ON` to your CMake configure command.
|
2
docs/build/Linux.md
vendored
2
docs/build/Linux.md
vendored
|
@ -12,7 +12,7 @@ The following are handled by Eden's externals:
|
||||||
* [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+
|
* [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+
|
||||||
* [opus](https://opus-codec.org/downloads/) 1.3+
|
* [opus](https://opus-codec.org/downloads/) 1.3+
|
||||||
|
|
||||||
All other dependencies will be downloaded and built by [CPM](https://github.com/cpm-cmake/CPM.cmake/) if `YUZU_USE_CPM` is on, but will use system dependencies if available:
|
All other dependencies will be downloaded and built by [CPM](https://github.com/cpm-cmake/CPM.cmake/) if `YUZU_USE_CPM` is on, but will always use system dependencies if available:
|
||||||
|
|
||||||
* [Boost](https://www.boost.org/users/download/) 1.79.0+
|
* [Boost](https://www.boost.org/users/download/) 1.79.0+
|
||||||
* [Catch2](https://github.com/catchorg/Catch2) 2.13.7 - 2.13.9
|
* [Catch2](https://github.com/catchorg/Catch2) 2.13.7 - 2.13.9
|
||||||
|
|
76
docs/build/Solaris.md
vendored
76
docs/build/Solaris.md
vendored
|
@ -8,73 +8,12 @@ Run the usual update + install of essential toolings: `sudo pkg update && sudo p
|
||||||
- **gcc**: `sudo pkg install developer/gcc-14`.
|
- **gcc**: `sudo pkg install developer/gcc-14`.
|
||||||
- **clang**: Version 20 is broken, use `sudo pkg install developer/clang-19`.
|
- **clang**: Version 20 is broken, use `sudo pkg install developer/clang-19`.
|
||||||
|
|
||||||
Then install the libraies: `sudo pkg install qt6 boost glslang libzip library/lz4 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm`.
|
Then install the libraies: `sudo pkg install qt6 boost glslang libzip library/lz4 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm developer/fmt`.
|
||||||
|
|
||||||
fmtlib is not available on repositories and has to be manually built:
|
|
||||||
```sh
|
|
||||||
git clone --recurisve --depth=1 https://github.com/fmtlib/fmt.git
|
|
||||||
cd fmt
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -B build
|
|
||||||
cmake --build build
|
|
||||||
sudo cmake --install build
|
|
||||||
```
|
|
||||||
|
|
||||||
pkg lz4 doesn't provide a proper CMakeFile to find the library, has to also be manually built:
|
|
||||||
```sh
|
|
||||||
git clone --depth=1 https://github.com/lz4/lz4.git
|
|
||||||
cd lz4
|
|
||||||
gmake
|
|
||||||
sudo gmake install
|
|
||||||
```
|
|
||||||
|
|
||||||
Same goes for zstd:
|
|
||||||
```sh
|
|
||||||
git clone --depth=1 https://github.com/facebook/zstd.git
|
|
||||||
cd zstd
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -B build0 -S build/cmake
|
|
||||||
cmake --build build0
|
|
||||||
cd build0
|
|
||||||
sudo gmake install
|
|
||||||
```
|
|
||||||
|
|
||||||
pkg SDL2 is also not nice to work with on CMake, save yourself some pain and compile it yourself:
|
|
||||||
```sh
|
|
||||||
git clone --depth=1 --branch=release-2.32.8 https://github.com/libsdl-org/SDL
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -B build
|
|
||||||
cmake --build build
|
|
||||||
sudo cmake --install build
|
|
||||||
```
|
|
||||||
|
|
||||||
Audio is broken in OpenIndiana [see this issue](https://github.com/libsdl-org/SDL/issues/13405), go into `SDL/CMakeLists.txt` and comment out lines 1468:
|
|
||||||
```diff
|
|
||||||
+# set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
|
|
||||||
+# file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
|
|
||||||
+# list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES})
|
|
||||||
+# set(HAVE_SDL_AUDIO TRUE)
|
|
||||||
```
|
|
||||||
For Solaris this issue does not exist - however PulseAudio crashes on Solaris - so use a different backend.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Build preparations:
|
|
||||||
Run the following command to clone eden with git:
|
|
||||||
```sh
|
|
||||||
git clone --recursive https://git.eden-emu.dev/eden-emu/eden
|
|
||||||
```
|
|
||||||
You usually want to add the `--recursive` parameter as it also takes care of the external dependencies for you.
|
|
||||||
|
|
||||||
Now change into the eden directory and create a build directory there:
|
|
||||||
```sh
|
|
||||||
cd eden
|
|
||||||
mkdir build
|
|
||||||
```
|
|
||||||
|
|
||||||
Change into that build directory: `cd build`
|
|
||||||
|
|
||||||
Now choose one option either 1 or 2, but not both as one option overwrites the other.
|
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
|
Clone eden with git `git clone --recursive https://git.eden-emu.dev/eden-emu/eden`
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Needed for some dependencies that call cc directly (tz)
|
# Needed for some dependencies that call cc directly (tz)
|
||||||
echo '#!/bin/sh' >cc
|
echo '#!/bin/sh' >cc
|
||||||
|
@ -83,7 +22,12 @@ chmod +x cc
|
||||||
export PATH="$PATH:$PWD"
|
export PATH="$PATH:$PWD"
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Configure**: `cmake -B build -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_SDL2=OFF -DYUZU_USE_EXTERNAL_SDL2=OFF -DYUZU_USE_LLVM_DEMANGLE=OFF -DYUZU_USE_QT_MULTIMEDIA=OFF -DYUZU_USE_QT_WEB_ENGINE=OFF -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_USE_BUNDLED_QT=OFF -DENABLE_QT=OFF -DSDL_AUDIO=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_QT_UPDATE_CHECKER=OFF`.
|
Patch for FFmpeg:
|
||||||
|
```sh
|
||||||
|
sed -i 's/ make / gmake /' externals/ffmpeg/CMakeFiles/ffmpeg-build.dir/build.make
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Configure**: `cmake -B build -DYUZU_USE_CPM=ON -DCMAKE_CXX_FLAGS="-I/usr/include/SDL2" -DCMAKE_C_FLAGS="-I/usr/include/SDL2"`.
|
||||||
- **Build**: `cmake --build build`.
|
- **Build**: `cmake --build build`.
|
||||||
- **Installing**: `sudo cmake --install build`.
|
- **Installing**: `sudo cmake --install build`.
|
||||||
|
|
||||||
|
@ -104,4 +48,4 @@ export LIBGL_ALWAYS_SOFTWARE=1
|
||||||
|
|
||||||
- Modify the generated ffmpeg.make (in build dir) if using multiple threads (base system `make` doesn't use `-j4`, so change for `gmake`).
|
- Modify the generated ffmpeg.make (in build dir) if using multiple threads (base system `make` doesn't use `-j4`, so change for `gmake`).
|
||||||
- If using OpenIndiana, due to a bug in SDL2 cmake configuration; Audio driver defaults to SunOS `<sys/audioio.h>`, which does not exist on OpenIndiana.
|
- If using OpenIndiana, due to a bug in SDL2 cmake configuration; Audio driver defaults to SunOS `<sys/audioio.h>`, which does not exist on OpenIndiana.
|
||||||
- Enabling OpenSSL requires compiling OpenSSL manually instead of using the provided one from repositores.
|
- System OpenSSL generally does not work. Instead, use `-DYUZU_USE_CPM=ON` to use a bundled static OpenSSL, or build a system dependency from source.
|
1
externals/CMakeLists.txt
vendored
1
externals/CMakeLists.txt
vendored
|
@ -139,6 +139,7 @@ endif()
|
||||||
|
|
||||||
# Sirit
|
# Sirit
|
||||||
# TODO(crueter): spirv-tools doesn't work w/ system
|
# TODO(crueter): spirv-tools doesn't work w/ system
|
||||||
|
set(SPIRV_WERROR OFF)
|
||||||
AddPackage(
|
AddPackage(
|
||||||
NAME SPIRV-Headers
|
NAME SPIRV-Headers
|
||||||
REPO "KhronosGroup/SPIRV-Headers"
|
REPO "KhronosGroup/SPIRV-Headers"
|
||||||
|
|
|
@ -8,7 +8,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
# Set the RPATH for Qt Libraries
|
# Set the RPATH for Qt Libraries
|
||||||
# This must be done before the `yuzu` target is created
|
# This must be done before the `yuzu` target is created
|
||||||
if (YUZU_USE_BUNDLED_QT AND (PLATFORM_LINUX))
|
if (YUZU_USE_BUNDLED_QT AND PLATFORM_LINUX)
|
||||||
set(CMAKE_BUILD_RPATH "${CMAKE_BINARY_DIR}/bin/lib/")
|
set(CMAKE_BUILD_RPATH "${CMAKE_BINARY_DIR}/bin/lib/")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -499,7 +499,7 @@ endif()
|
||||||
|
|
||||||
# Explicit linking required
|
# Explicit linking required
|
||||||
if (PLATFORM_SUN)
|
if (PLATFORM_SUN)
|
||||||
target_link_libraries(yuzu PRIVATE X11)
|
target_link_libraries(yuzu PRIVATE X11 "/usr/lib/xorg/amd64/libdrm.so")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Extra deps
|
# Extra deps
|
||||||
|
|
|
@ -42,7 +42,7 @@ target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers)
|
||||||
|
|
||||||
# In Solaris needs explicit linking for ffmpeg which links to /lib/amd64/libX11.so
|
# In Solaris needs explicit linking for ffmpeg which links to /lib/amd64/libX11.so
|
||||||
if (PLATFORM_SUN)
|
if (PLATFORM_SUN)
|
||||||
target_link_libraries(yuzu-cmd PRIVATE X11)
|
target_link_libraries(yuzu-cmd PRIVATE X11 "/usr/lib/xorg/amd64/libdrm.so")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue