Compare commits

...

7 Commits

Author SHA1 Message Date
Jaeden Amero
c87742a202
Merge 5db9c0d508 into 5e8beb3ab7 2024-11-14 00:45:37 +05:30
Nadia Holmquist Pedersen
5e8beb3ab7 fix a typo
Some checks are pending
macOS / ${{ matrix.arch }} (arm64) (push) Waiting to run
macOS / ${{ matrix.arch }} (x86_64) (push) Waiting to run
macOS / Universal binary (push) Blocked by required conditions
Ubuntu / x86_64 (push) Waiting to run
Ubuntu / aarch64 (push) Waiting to run
Windows / build (push) Waiting to run
2024-11-13 15:23:59 +01:00
Nadia Holmquist Pedersen
7c1d2a64f4 Set WIN32_LEAN_AND_MEAN, gets rid of the winsock2 warnings and probably
Some checks failed
macOS / ${{ matrix.arch }} (arm64) (push) Has been cancelled
macOS / ${{ matrix.arch }} (x86_64) (push) Has been cancelled
Ubuntu / x86_64 (push) Has been cancelled
Ubuntu / aarch64 (push) Has been cancelled
Windows / build (push) Has been cancelled
macOS / Universal binary (push) Has been cancelled
speeds up compilation a tiny bit

oh and NOMINMAX too for good measure while we're at it
2024-11-11 14:18:05 +01:00
Nadia Holmquist Pedersen
b2f6fab6f4 cmake: use interface include directories properly
and fix an indent I guess
2024-11-11 12:06:12 +01:00
RSDuck
4528441c74 for OGL renderer W buffer rendering avoid undefined vertex z
Some checks failed
macOS / ${{ matrix.arch }} (arm64) (push) Has been cancelled
macOS / ${{ matrix.arch }} (x86_64) (push) Has been cancelled
Ubuntu / x86_64 (push) Has been cancelled
Ubuntu / aarch64 (push) Has been cancelled
Windows / build (push) Has been cancelled
macOS / Universal binary (push) Has been cancelled
see https://github.com/melonDS-emu/melonDS/issues/2017
2024-11-09 14:19:02 +01:00
Nadia Holmquist Pedersen
8e3f6cc519 add missing qtbase-private-devel for Fedora
Some checks are pending
macOS / ${{ matrix.arch }} (arm64) (push) Waiting to run
macOS / ${{ matrix.arch }} (x86_64) (push) Waiting to run
macOS / Universal binary (push) Blocked by required conditions
Ubuntu / x86_64 (push) Waiting to run
Ubuntu / aarch64 (push) Waiting to run
Windows / build (push) Waiting to run
2024-11-09 08:32:34 +01:00
Jaeden Amero
5db9c0d508 Fix build for clang
Remove declaring _POSIX_SOURCE manually. Let the compiler take care of
this on its own, except on Windows where the compiler doesn't take care
of this. Additionally, include a missing header file for the definition
of struct sockaddr_in, which we need before we can allocate the struct.
With these fixes, we can build with Clang 18.1.5, although there are
many warnings.
2024-07-12 17:57:07 +00:00
7 changed files with 22 additions and 13 deletions

View File

@ -12,7 +12,7 @@
* 22.04: `sudo apt install qtbase6-dev qtbase6-private-dev qtmultimedia6-dev libqt6svg6-dev`
* Older versions: `sudo apt install qtbase5-dev qtbase5-private-dev qtmultimedia5-dev libqt5svg5-dev`
Also add `-DUSE_QT6=OFF` to the first CMake command below.
* Fedora: `sudo dnf install gcc-c++ cmake extra-cmake-modules SDL2-devel libarchive-devel enet-devel libzstd-devel qt6-{qtbase,qtmultimedia,qtsvg}-devel wayland-devel`
* Fedora: `sudo dnf install gcc-c++ cmake extra-cmake-modules SDL2-devel libarchive-devel enet-devel libzstd-devel qt6-{qtbase,qtbase-private,qtmultimedia,qtsvg}-devel wayland-devel`
* Arch Linux: `sudo pacman -S base-devel cmake extra-cmake-modules git libpcap sdl2 qt6-{base,multimedia,svg} libarchive enet zstd`
2. Download the melonDS repository and prepare:
```bash
@ -47,7 +47,7 @@
1. Install Qt: `pacman -S <prefix>-{qt6-base,qt6-svg,qt6-multimedia,qt6-svg,qt6-tools}`
2. Set up the build directory with `cmake -B build`
* Static builds (without DLLs, standalone executable)
1. Install Qt: `pacman -S <prefi>-qt5-static`
1. Install Qt: `pacman -S <prefix>-qt5-static`
(Note: As of writing, the `qt6-static` package does not work.)
2. Set up the build directory with `cmake -B build -DBUILD_STATIC=ON -DUSE_QT6=OFF -DCMAKE_PREFIX_PATH=$MSYSTEM_PREFIX/qt5-static`
7. Compile: `cmake --build build`
@ -78,4 +78,4 @@ If you want an app bundle that can be distributed to other computers without nee
melonDS provides a Nix flake with support for both macOS and Linux. The [Nix package manager](https://nixos.org) needs to be installed to use it.
* To run melonDS, just type `nix run github:melonDS-emu/melonDS`.
* To get a shell for development, clone the melonDS repository and type `nix develop` in its directory.
* To get a shell for development, clone the melonDS repository and type `nix develop` in its directory.

View File

@ -127,6 +127,8 @@ if (ENABLE_JIT)
endif()
endif()
target_include_directories(core INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
set(MELONDS_VERSION_SUFFIX "$ENV{MELONDS_VERSION_SUFFIX}" CACHE STRING "Suffix to add to displayed melonDS version")
option(MELONDS_EMBED_BUILD_INFO "Embed detailed build info into the binary" OFF)
set(MELONDS_GIT_BRANCH "$ENV{MELONDS_GIT_BRANCH}" CACHE STRING "The Git branch used for this build")
@ -178,13 +180,14 @@ endif()
if (WIN32)
target_link_libraries(core PRIVATE ole32 comctl32 wsock32 ws2_32)
target_compile_definitions(core PUBLIC WIN32_LEAN_AND_MEAN NOMINMAX)
elseif(NOT APPLE AND NOT HAIKU)
check_library_exists(rt shm_open "" NEED_LIBRT)
if (NEED_LIBRT)
target_link_libraries(core PRIVATE rt)
endif()
elseif(HAIKU)
target_link_libraries(core PRIVATE network)
target_link_libraries(core PRIVATE network)
endif()
if (ENABLE_JIT_PROFILING)

View File

@ -681,6 +681,7 @@ void main()
vec4 fpos;
fpos.xy = (((vec2(vPosition.xy) ) * 2.0) / uScreenSize) - 1.0;
fpos.z = 0.0;
fZ = float(vPosition.z << zshift) / 16777216.0;
fpos.w = float(vPosition.w) / 65536.0f;
fpos.xy *= fpos.w;

View File

@ -14,6 +14,7 @@
#ifndef _WIN32
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <poll.h>
#include <signal.h>

View File

@ -3,8 +3,13 @@
/* (C)ChaN, 2018 */
/*------------------------------------------------------------------------*/
#ifdef _WIN32
/* Windows will not define localtime_r for us unless we explicitly request it
* with macros. */
#define _POSIX_SOURCE
#define _POSIX_THREAD_SAFE_FUNCTIONS
#endif
#include <time.h>
#include "ff.h"

View File

@ -91,8 +91,7 @@ add_compile_definitions(ARCHIVE_SUPPORT_ENABLED)
add_executable(melonDS ${SOURCES_QT_SDL})
add_subdirectory("../../net"
"${CMAKE_BINARY_DIR}/net"
)
${CMAKE_BINARY_DIR}/net)
target_link_libraries(melonDS PRIVATE net-utils)
@ -171,10 +170,10 @@ if (BUILD_STATIC)
endif()
endif()
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..")
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../../net")
target_include_directories(melonDS PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/..")
if (USE_QT6)
target_include_directories(melonDS PUBLIC ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
else()

View File

@ -11,9 +11,9 @@ add_library(net-utils STATIC
MPInterface.cpp
)
target_include_directories(net-utils PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories(net-utils PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_include_directories(net-utils PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/..")
option(USE_SYSTEM_LIBSLIRP "Use system libslirp instead of the bundled version" OFF)
if (USE_SYSTEM_LIBSLIRP)