Add a static Makefile for the libretro core

Builds parallel_gamecubewii_libretro for every lane .gitlab-ci.yml covers:
unix (Linux x86_64/aarch64), webos, win64 (MinGW-w64), osx (x86_64/arm64,
CROSS_COMPILE), ios-arm64, tvos-arm64, android-arm64 and android-x86_64.
The source lists and per-library flags follow what the CMake LIBRETRO=ON
build links into the core, without the units only the standalone frontends
use. The per-platform configure results for curl, libusb, libiconv and mGBA
are checked in under Externals/<library>/makefile; the remaining generated
files are produced by the Makefile under obj/gen.

The Android input backend's JNI entry points belong to the Android app and
are left out of the core, which links with --no-undefined everywhere.

The Windows code builds against MinGW-w64 headers older than 12.0 as well:
D3D12 includes d3d12sdklayers.h explicitly, and the constants, declarations
and const-correct pointer types those headers lack for D3D12, device
notifications, the Wii Remote Bluetooth path, the IOS IP stack and thread
naming are provided locally.
This commit is contained in:
LibretroAdmin authored and libretroadmin committed 2026-11-04 23:49:57 +01:00
1 parent 32c61f9d0e
commit 6e35fc179b
16 files changed
+4389 -5

No files matched your search

+4
View File
@@ -48,3 +48,7 @@ CMakeLists.txt.user
.cache/clangd .cache/clangd
# Ignore CMake user presets # Ignore CMake user presets
CMakeUserPresets.json CMakeUserPresets.json
# Ignore the libretro core built by the static Makefile
/parallel_gamecubewii_libretro*.so
/parallel_gamecubewii_libretro*.dll
/parallel_gamecubewii_libretro*.dylib
File diff suppressed because it is too large. Load diff
+30
View File
@@ -0,0 +1,30 @@
/* libiconv config.h for the static Makefile build (Android from the NDK configure; the Apple values are the Linux ones with the Darwin differences applied). */
#ifndef LIBICONV_CONFIG_H_MAKEFILE
#define LIBICONV_CONFIG_H_MAKEFILE
#define ENABLE_EXTRA 0
#define ENABLE_RELOCATABLE 1
/* #undef mbstate_t */
#define HAVE_ICONV 0
#define ICONV_CONST
#define HAVE_GETC_UNLOCKED 1
#if defined(__ANDROID__)
#define HAVE_LANGINFO_CODESET 0
#else
#define HAVE_LANGINFO_CODESET 1
#endif
#define HAVE_MBRTOWC 1
#define HAVE_SETLOCALE 1
#define HAVE_STDDEF_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_VISIBILITY 1
#define HAVE_WCRTOMB 1
#define HAVE_WORKING_O_NOFOLLOW 1
#define WORDS_LITTLEENDIAN 1
/* #undef INSTALLPREFIX */
/* #undef inline */
/* #undef mode_t */
/* #undef ssize_t */
#endif
+66
View File
@@ -0,0 +1,66 @@
/* libcharset config.h for the static Makefile build (Android from the NDK configure; the Apple values are the Linux ones with the Darwin differences applied). */
#ifndef LIBCHARSET_CONFIG_H_MAKEFILE
#define LIBCHARSET_CONFIG_H_MAKEFILE
#if defined(__ANDROID__)
#define HAVE_COPY_FILE_RANGE 0
#elif defined(__APPLE__)
#define HAVE_COPY_FILE_RANGE 0
#else
#define HAVE_COPY_FILE_RANGE 1
#endif
#define HAVE_DLFCN_H 1
#define HAVE_INTTYPES_H 1
#if defined(__ANDROID__)
#define HAVE_LANGINFO_CODESET 0
#elif defined(__APPLE__)
#define HAVE_LANGINFO_CODESET 1
#else
#define HAVE_LANGINFO_CODESET 1
#endif
#if defined(__ANDROID__)
#define HAVE_MACH_O_DYLD_H 0
#elif defined(__APPLE__)
#define HAVE_MACH_O_DYLD_H 1
#else
#define HAVE_MACH_O_DYLD_H 0
#endif
#define HAVE_MINIX_CONFIG_H 0
#define HAVE_SETLOCALE 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYMLINK 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define HAVE_VISIBILITY 1
#define HAVE_WCHAR_H 1
#if defined(__ANDROID__)
#define HAVE_WORKING_O_NOATIME 1
#elif defined(__APPLE__)
#define HAVE_WORKING_O_NOATIME 0
#else
#define HAVE_WORKING_O_NOATIME 0
#endif
#define HAVE_WORKING_O_NOFOLLOW 1
#if defined(__ANDROID__)
#define HAVE__NSGETEXECUTABLEPATH 0
#elif defined(__APPLE__)
#define HAVE__NSGETEXECUTABLEPATH 1
#else
#define HAVE__NSGETEXECUTABLEPATH 0
#endif
/* #undef INSTALLPREFIX */
#define LT_OBJDIR ".libs"
/* #undef PACKAGE_BUGREPORT */
#define PACKAGE_NAME "libcharset"
#define PACKAGE_STRING "libcharset 1.5"
#define PACKAGE_TARNAME "libcharset"
/* #undef PACKAGE_URL */
#define PACKAGE_VERSION "1.5"
#define STDC_HEADERS 1
#endif
+150
View File
@@ -0,0 +1,150 @@
/* libusb config.h for the static Makefile build: the CMake configure results for Windows (MinGW-w64) and Linux merged into one header. The macOS values are the Linux ones with the Darwin differences applied and were not produced by a configure run. */
#ifndef LIBUSB_CONFIG_H_MAKEFILE
#define LIBUSB_CONFIG_H_MAKEFILE
#define DEFAULT_VISIBILITY __attribute__((visibility("default")))
/* #undef ENABLE_DEBUG_LOGGING */
/* #undef ENABLE_LOGGING */
#if defined(_WIN32)
/* #undef HAVE_ASM_TYPES_H */
#elif defined(__APPLE__)
/* #undef HAVE_ASM_TYPES_H */
#else
#define HAVE_ASM_TYPES_H 1
#endif
#define HAVE_CLOCK_GETTIME 1
#if defined(_WIN32)
/* #undef HAVE_DECL_EFD_CLOEXEC */
#elif defined(__APPLE__)
/* #undef HAVE_DECL_EFD_CLOEXEC */
#else
#define HAVE_DECL_EFD_CLOEXEC 1
#endif
#if defined(_WIN32)
/* #undef HAVE_DECL_EFD_NONBLOCK */
#elif defined(__APPLE__)
/* #undef HAVE_DECL_EFD_NONBLOCK */
#else
#define HAVE_DECL_EFD_NONBLOCK 1
#endif
#if defined(_WIN32)
/* #undef HAVE_DECL_TFD_CLOEXEC */
#elif defined(__APPLE__)
/* #undef HAVE_DECL_TFD_CLOEXEC */
#else
#define HAVE_DECL_TFD_CLOEXEC 1
#endif
#if defined(_WIN32)
/* #undef HAVE_DECL_TFD_NONBLOCK */
#elif defined(__APPLE__)
/* #undef HAVE_DECL_TFD_NONBLOCK */
#else
#define HAVE_DECL_TFD_NONBLOCK 1
#endif
#if defined(_WIN32)
/* #undef HAVE_DLFCN_H */
#elif defined(__APPLE__)
#define HAVE_DLFCN_H 1
#else
#define HAVE_DLFCN_H 1
#endif
#if defined(_WIN32)
/* #undef HAVE_EVENTFD */
#elif defined(__APPLE__)
/* #undef HAVE_EVENTFD */
#else
#define HAVE_EVENTFD 1
#endif
#define HAVE_INTTYPES_H 1
#if defined(_WIN32)
/* #undef HAVE_IOKIT_USB_IOUSBHOSTFAMILYDEFINITIONS_H */
#elif defined(__APPLE__)
#define HAVE_IOKIT_USB_IOUSBHOSTFAMILYDEFINITIONS_H 1
#else
/* #undef HAVE_IOKIT_USB_IOUSBHOSTFAMILYDEFINITIONS_H */
#endif
/* #undef HAVE_LIBUDEV */
#define HAVE_MEMORY_H 1
#if defined(_WIN32)
/* #undef HAVE_NFDS_T */
#elif defined(__APPLE__)
#define HAVE_NFDS_T 1
#else
#define HAVE_NFDS_T 1
#endif
#if defined(_WIN32)
/* #undef HAVE_PIPE2 */
#elif defined(__APPLE__)
/* #undef HAVE_PIPE2 */
#else
#define HAVE_PIPE2 1
#endif
#if defined(_WIN32)
#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
#elif defined(__APPLE__)
/* #undef HAVE_PTHREAD_CONDATTR_SETCLOCK */
#else
#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
#endif
#define HAVE_PTHREAD_SETNAME_NP 1
#if defined(_WIN32)
/* #undef HAVE_PTHREAD_THREADID_NP */
#elif defined(__APPLE__)
#define HAVE_PTHREAD_THREADID_NP 1
#else
/* #undef HAVE_PTHREAD_THREADID_NP */
#endif
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_STRUCT_TIMESPEC 1
#if defined(_WIN32)
/* #undef HAVE_SYSLOG */
#elif defined(__APPLE__)
#define HAVE_SYSLOG 1
#else
#define HAVE_SYSLOG 1
#endif
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TYPES_H 1
#if defined(_WIN32)
/* #undef HAVE_TIMERFD */
#elif defined(__APPLE__)
/* #undef HAVE_TIMERFD */
#else
#define HAVE_TIMERFD 1
#endif
#define HAVE_UNISTD_H 1
/* #undef LT_OBJDIR */
/* #undef PACKAGE */
/* #undef PACKAGE_BUGREPORT */
/* #undef PACKAGE_NAME */
/* #undef PACKAGE_STRING */
/* #undef PACKAGE_TARNAME */
/* #undef PACKAGE_URL */
/* #undef PACKAGE_VERSION */
#if defined(_WIN32)
/* #undef PLATFORM_POSIX */
#elif defined(__APPLE__)
#define PLATFORM_POSIX 1
#else
#define PLATFORM_POSIX 1
#endif
#if defined(_WIN32)
#define PLATFORM_WINDOWS 1
#elif defined(__APPLE__)
/* #undef PLATFORM_WINDOWS */
#else
/* #undef PLATFORM_WINDOWS */
#endif
#define PRINTF_FORMAT(a, b) __attribute__((format(printf, a, b)))
/* #undef STDC_HEADERS */
/* #undef UMOCKDEV_HOTPLUG */
#define USE_SYSTEM_LOGGING_FACILITY 1
/* #undef VERSION */
#define _GNU_SOURCE
/* #undef inline */
#endif
+171
View File
@@ -0,0 +1,171 @@
/* mGBA flags.h for the static Makefile build: the CMake configure results for Windows, Android and Linux merged into one header (Apple follows the Linux values). */
#ifndef FLAGS_H_MAKEFILE
#define FLAGS_H_MAKEFILE
#ifndef FLAGS_H
#define FLAGS_H
#endif
#ifndef MINIMAL_CORE
/* #undef MINIMAL_CORE */
#endif
#ifndef BUILD_GL
/* #undef BUILD_GL */
#endif
#ifndef BUILD_GLES2
/* #undef BUILD_GLES2 */
#endif
#ifndef BUILD_GLES3
/* #undef BUILD_GLES3 */
#endif
#ifndef COLOR_16_BIT
/* #undef COLOR_16_BIT */
#endif
#ifndef COLOR_5_6_5
/* #undef COLOR_5_6_5 */
#endif
#ifndef DISABLE_THREADING
/* #undef DISABLE_THREADING */
#endif
#ifndef FIXED_ROM_BUFFER
/* #undef FIXED_ROM_BUFFER */
#endif
#ifndef M_CORE_GBA
#define M_CORE_GBA
#endif
#ifndef M_CORE_GB
#define M_CORE_GB
#endif
#ifndef ENABLE_DEBUGGERS
/* #undef ENABLE_DEBUGGERS */
#endif
#ifndef ENABLE_DIRECTORIES
/* #undef ENABLE_DIRECTORIES */
#endif
#ifndef ENABLE_GDB_STUB
/* #undef ENABLE_GDB_STUB */
#endif
#ifndef ENABLE_SCRIPTING
/* #undef ENABLE_SCRIPTING */
#endif
#ifndef ENABLE_VFS
#define ENABLE_VFS
#endif
#ifndef ENABLE_VFS_FD
/* #undef ENABLE_VFS_FD */
#endif
#ifndef ENABLE_VFS_FILE
/* #undef ENABLE_VFS_FILE */
#endif
#ifndef USE_DISCORD_RPC
/* #undef USE_DISCORD_RPC */
#endif
#ifndef USE_EDITLINE
/* #undef USE_EDITLINE */
#endif
#ifndef USE_ELF
/* #undef USE_ELF */
#endif
#ifndef USE_EPOXY
/* #undef USE_EPOXY */
#endif
#ifndef USE_FFMPEG
/* #undef USE_FFMPEG */
#endif
#ifndef USE_FREETYPE
/* #undef USE_FREETYPE */
#endif
#ifndef USE_JSON_C
/* #undef USE_JSON_C */
#endif
#ifndef USE_LIBAV
/* #undef USE_LIBAV */
#endif
#ifndef USE_LIBAVRESAMPLE
/* #undef USE_LIBAVRESAMPLE */
#endif
#ifndef USE_LIBSWRESAMPLE
/* #undef USE_LIBSWRESAMPLE */
#endif
#ifndef USE_LIBZIP
/* #undef USE_LIBZIP */
#endif
#ifndef USE_LUA
/* #undef USE_LUA */
#endif
#ifndef USE_LZMA
#define USE_LZMA
#endif
#ifndef USE_MINIZIP
/* #undef USE_MINIZIP */
#endif
#ifndef USE_PNG
/* #undef USE_PNG */
#endif
#ifndef USE_PTHREADS
#if defined(_WIN32)
/* #undef USE_PTHREADS */
#elif defined(__ANDROID__)
#define USE_PTHREADS
#else
#define USE_PTHREADS
#endif
#endif
#ifndef USE_SQLITE3
/* #undef USE_SQLITE3 */
#endif
#ifndef USE_ZLIB
/* #undef USE_ZLIB */
#endif
#ifndef HAVE_CRC32
/* #undef HAVE_CRC32 */
#endif
#ifndef HAVE_LOCALE
/* #undef HAVE_LOCALE */
#endif
#ifndef HAVE_LOCALTIME_R
#if defined(_WIN32)
/* #undef HAVE_LOCALTIME_R */
#elif defined(__ANDROID__)
#define HAVE_LOCALTIME_R
#else
#define HAVE_LOCALTIME_R
#endif
#endif
#ifndef HAVE_POPCOUNT32
/* #undef HAVE_POPCOUNT32 */
#endif
#ifndef HAVE_PTHREAD_NP_H
/* #undef HAVE_PTHREAD_NP_H */
#endif
#ifndef HAVE_PTHREAD_SETNAME_NP
#define HAVE_PTHREAD_SETNAME_NP
#endif
#ifndef HAVE_SNPRINTF_L
/* #undef HAVE_SNPRINTF_L */
#endif
#ifndef HAVE_STRDUP
#define HAVE_STRDUP
#endif
#ifndef HAVE_STRLCPY
#if defined(_WIN32)
/* #undef HAVE_STRLCPY */
#elif defined(__ANDROID__)
#define HAVE_STRLCPY
#else
#define HAVE_STRLCPY
#endif
#endif
#ifndef HAVE_STRTOF_L
/* #undef HAVE_STRTOF_L */
#endif
#ifndef HAVE_XLOCALE
#if defined(_WIN32)
/* #undef HAVE_XLOCALE */
#elif defined(__ANDROID__)
#define HAVE_XLOCALE
#else
/* #undef HAVE_XLOCALE */
#endif
#endif
#endif
+321
View File
@@ -0,0 +1,321 @@
DEBUG = 0
HAVE_VULKAN = 1
LINK_STATIC_LIBCPLUSPLUS = 1
LTO ?=
CORE_DIR := .
TARGET_NAME := parallel_gamecubewii
ifeq ($(ECHO),1)
E := 1
endif
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -s),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -s)),)
platform = osx
else ifneq ($(findstring MINGW,$(shell uname -s)),)
platform = win
endif
endif
# webOS SDK toolchains are plain Linux cross compilers; their name is what
# tells them apart, as in the CMake build.
ifneq (,$(findstring webos,$(CC)))
ifneq (,$(findstring unix,$(platform)))
override platform := webos
endif
endif
# ----------------------------------------------------------------------------
# Target architecture: taken from the compiler (or the Apple -arch/-target
# selection), not the host, so cross builds pick the right JIT and SIMD code.
# ----------------------------------------------------------------------------
ifeq ($(platform), osx)
ifeq ($(CROSS_COMPILE),1)
arch := $(firstword $(subst -, ,$(LIBRETRO_APPLE_PLATFORM)))
endif
ifeq ($(arch),)
arch := $(shell uname -m)
endif
else ifneq (,$(filter ios-arm64 tvos-arm64 android-arm64,$(platform)))
arch := arm64
else ifeq ($(platform), android-x86_64)
arch := x86_64
else ifeq ($(arch),)
arch := $(firstword $(subst -, ,$(shell $(CC) -dumpmachine 2>/dev/null)))
ifeq ($(arch),)
arch := $(shell uname -m)
endif
endif
ifneq (,$(filter x86_64 amd64 x64,$(arch)))
ARCH_X86_64 := 1
arch := x86_64
else ifneq (,$(filter aarch64 arm64 arm,$(arch)))
ARCH_ARM64 := 1
arch := arm64
else
$(error Unsupported target architecture '$(arch)': the core builds for x86_64 and arm64)
endif
HAVE_LIBUSB := 0
HAVE_HIDAPI := 0
HAVE_CPPIPC := 0
HAVE_D3D := 0
HAVE_SPIRV_CROSS := 0
HAVE_BUNDLED_ICONV := 0
FLAGS :=
CFLAGS :=
CXXFLAGS :=
LDFLAGS :=
LIBS :=
# Unix (Linux) and webOS
ifneq (,$(filter unix webos,$(platform)))
OS_UNIX := 1
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
ifeq ($(platform), webos)
FLAGS += -D__WEBOS__ -DSKIP_WIMOTESCANNER_THREAD -DSKIP_GCMEMCARD_THREAD \
-DSKIP_SAVESTATE_THREAD -DSKIP_NETWORK_WORKER_THREAD -DSKIP_ASSETLOADER_THREAD \
-DSKIP_WICONNECT24_WORKER_THREAD -DSKIP_RESOURCE_WORKER_THREAD \
-DSKIP_KDSCHEDULER_TIMER_THREAD
HAVE_VULKAN := 0
else
HAVE_LIBUSB := 1
HAVE_HIDAPI := 1
endif
HAVE_CPPIPC := 1
ifeq ($(LINK_STATIC_LIBCPLUSPLUS),1)
LDFLAGS += -static-libgcc -static-libstdc++
endif
LIBS += -lpthread -ldl -lrt
# macOS
else ifeq ($(platform), osx)
OS_APPLE := 1
OS_MACOS := 1
TARGET := $(TARGET_NAME)_libretro.dylib
fpic := -fPIC
SHARED := -dynamiclib
MACOS_MINVER ?= 11.0
ifeq ($(CROSS_COMPILE),1)
TARGET_RULE := -target $(arch)-apple-macos$(MACOS_MINVER) -isysroot $(LIBRETRO_APPLE_ISYSROOT)
else
TARGET_RULE := -arch $(arch) -mmacosx-version-min=$(MACOS_MINVER)
endif
FLAGS += $(TARGET_RULE)
LDFLAGS += $(TARGET_RULE) -Wl,-dead_strip
HAVE_LIBUSB := 1
HAVE_HIDAPI := 1
HAVE_SPIRV_CROSS := 1
HAVE_BUNDLED_ICONV := 1
LIBS += -framework AppKit -framework CoreFoundation -framework Foundation \
-framework IOKit -framework CoreServices -framework IOBluetooth \
-framework Security -lobjc -lresolv
# iOS / tvOS
else ifneq (,$(filter ios-arm64 tvos-arm64,$(platform)))
OS_APPLE := 1
OS_IOS := 1
fpic := -fPIC
SHARED := -dynamiclib
ifeq ($(platform), tvos-arm64)
TARGET := $(TARGET_NAME)_libretro_tvos.dylib
MINVER ?= 14.0
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcrun -sdk appletvos -show-sdk-path)
endif
MINVER_FLAG := -mappletvos-version-min=$(MINVER)
else
TARGET := $(TARGET_NAME)_libretro_ios.dylib
IOS_MINVER ?= 14.0
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcrun -sdk iphoneos -show-sdk-path)
endif
MINVER_FLAG := -miphoneos-version-min=$(IOS_MINVER)
endif
CC = cc -arch arm64 -isysroot $(IOSSDK)
CXX = c++ -arch arm64 -isysroot $(IOSSDK)
FLAGS += $(MINVER_FLAG) -DIPHONEOS
LDFLAGS += $(MINVER_FLAG)
HAVE_SPIRV_CROSS := 1
HAVE_BUNDLED_ICONV := 1
LIBS += -framework CoreFoundation -framework Foundation -framework IOKit -lobjc -lresolv
# Android (NDK clang)
else ifneq (,$(filter android-arm64 android-x86_64,$(platform)))
OS_ANDROID := 1
TARGET := $(TARGET_NAME)_libretro_android.so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
ifeq ($(platform), android-arm64)
ANDROID_API ?= 21
ANDROID_TRIPLE := aarch64-linux-android$(ANDROID_API)
else
ANDROID_API ?= 24
ANDROID_TRIPLE := x86_64-linux-android$(ANDROID_API)
endif
NDK_ROOT ?= $(ANDROID_NDK_ROOT)
ANDROID_NDK_LLVM ?= $(NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64
CC = $(ANDROID_NDK_LLVM)/bin/clang --target=$(ANDROID_TRIPLE)
CXX = $(ANDROID_NDK_LLVM)/bin/clang++ --target=$(ANDROID_TRIPLE)
AR = $(ANDROID_NDK_LLVM)/bin/llvm-ar
FLAGS += -DANDROID -DHAVE_EGL=1 -I$(CORE_DIR)/Source/Android -funwind-tables
LDFLAGS += -static-libstdc++
HAVE_BUNDLED_ICONV := 1
LIBS += -lEGL -lOpenSLES -landroid -llog -latomic -lm -ldl
# Windows (MinGW-w64, native MSYS2 or cross)
else
OS_WIN := 1
TARGET := $(TARGET_NAME)_libretro.dll
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
FLAGS += -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 \
-DWINDOWS_FOUNDATION_UNIVERSALAPICONTRACT_VERSION=0x50000
HAVE_LIBUSB := 1
HAVE_HIDAPI := 1
HAVE_CPPIPC := 1
HAVE_D3D := 1
HAVE_SPIRV_CROSS := 1
LDFLAGS += -static-libgcc -static-libstdc++ -static
LIBS += -lsetupapi -lcfgmgr32 -lshlwapi -liphlpapi -lwinmm -lws2_32 -lbcrypt \
-ladvapi32 -lcrypt32 -lsecur32 -lole32 -loleaut32 -luuid -lshell32 \
-luser32 -lgdi32 -lkernel32 -lwinpthread
endif
GEN_DIR := $(CORE_DIR)/obj/gen
OBJ_DIR := $(CORE_DIR)/obj/$(platform)-$(arch)
include Makefile.common
# ----------------------------------------------------------------------------
# Compiler flags
# ----------------------------------------------------------------------------
FLAGS += -D__LIBRETRO__ -D_ARCH_64=1 -D_DEFAULT_SOURCE -DHAS_OPENGL \
-DDATA_DIR=\"/usr/local/share/dolphin-emu/\" -I$(SRC_DIR)
ifeq ($(ARCH_X86_64),1)
FLAGS += -D_M_X86_64=1 -msse2
ifeq ($(OS_MACOS),1)
FLAGS += -mssse3 -march=core2
endif
else
FLAGS += -D_M_ARM_64=1 -march=armv8-a+crc
endif
ifneq (,$(filter 1,$(OS_UNIX) $(OS_APPLE)))
FLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
endif
ifeq ($(OS_APPLE),1)
FLAGS += -DFMT_EXCEPTIONS=0
endif
ifeq ($(HAVE_VULKAN),1)
FLAGS += -DHAS_VULKAN
endif
ifeq ($(HAVE_LIBUSB),1)
FLAGS += -D__LIBUSB__
endif
FLAGS += -fno-strict-aliasing -fno-exceptions -fomit-frame-pointer
# Everything the core does not export stays hidden; the libretro entry points
# carry visibility("default") through RETRO_API.
ifneq (,$(fpic))
FLAGS += $(fpic) -fno-semantic-interposition
endif
FLAGS += -fvisibility=hidden
CXXFLAGS += -fvisibility-inlines-hidden
ifeq ($(DEBUG), 1)
FLAGS += -O0 -g -D_DEBUG
else
FLAGS += -O3 -DNDEBUG
endif
ifneq ($(LTO),)
FLAGS += $(LTO)
LDFLAGS += $(LTO)
endif
ifneq ($(SANITIZER),)
FLAGS += -fsanitize=$(SANITIZER)
LDFLAGS += -fsanitize=$(SANITIZER)
endif
CFLAGS := $(FLAGS) $(CFLAGS)
CXXFLAGS := $(FLAGS) $(CXXFLAGS)
LDFLAGS += $(fpic) $(SHARED)
# ----------------------------------------------------------------------------
# Objects
# ----------------------------------------------------------------------------
# Objects live under obj/<platform>-<arch>, one tree per target, so the
# submodules stay clean and a second architecture never links the first
# one's objects.
obj_of = $(patsubst %,$(OBJ_DIR)/%.o,$(1))
define LIB_template
$(1)_OBJECTS := $$(call obj_of,$$($(1)_SOURCES_C) $$($(1)_SOURCES_CXX) $$($(1)_SOURCES_ASM) $$($(1)_SOURCES_OBJCXX))
$$($(1)_OBJECTS): GROUP := $(1)
OBJECTS += $$($(1)_OBJECTS)
endef
OBJECTS :=
$(foreach g,$(LIB_GROUPS),$(eval $(call LIB_template,$(g))))
DEPS := $(OBJECTS:.o=.d)
# The toolchain and configuration a tree was built with; a change wipes it,
# since nothing in an object's name says which compiler produced it.
BUILD_TAG := $(CC)|$(CXX)|$(platform)|$(arch)|$(DEBUG)|$(LTO)|$(SANITIZER)|$(HAVE_VULKAN)
BUILD_TAG_STATUS := $(shell \
if [ "`cat $(OBJ_DIR)/.build-tag 2>/dev/null`" != "$(BUILD_TAG)" ]; then \
rm -rf $(OBJ_DIR); mkdir -p $(OBJ_DIR); \
echo "$(BUILD_TAG)" > $(OBJ_DIR)/.build-tag; \
fi)
.DEFAULT_GOAL := all
all: $(TARGET)
-include $(DEPS)
$(OBJECTS): | $(GEN_HEADERS)
$(TARGET): $(OBJECTS)
@$(if $(E),echo LD $@,)
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS)
$(OBJ_DIR)/%.c.o: %.c
@mkdir -p $(@D)
@$(if $(E),echo CC $<,)
$(CC) $(CFLAGS) $($(GROUP)_FLAGS) $($(GROUP)_CFLAGS) $(FILE_FLAGS_$(abspath $<)) -MMD -MP -c $< -o $@
$(OBJ_DIR)/%.cpp.o: %.cpp
@mkdir -p $(@D)
@$(if $(E),echo CXX $<,)
$(CXX) $(CXXFLAGS) $($(GROUP)_FLAGS) $($(GROUP)_CXXFLAGS) $(FILE_FLAGS_$(abspath $<)) -MMD -MP -c $< -o $@
$(OBJ_DIR)/%.cc.o: %.cc
@mkdir -p $(@D)
@$(if $(E),echo CXX $<,)
$(CXX) $(CXXFLAGS) $($(GROUP)_FLAGS) $($(GROUP)_CXXFLAGS) $(FILE_FLAGS_$(abspath $<)) -MMD -MP -c $< -o $@
$(OBJ_DIR)/%.mm.o: %.mm
@mkdir -p $(@D)
@$(if $(E),echo OBJCXX $<,)
$(CXX) -x objective-c++ $(CXXFLAGS) $($(GROUP)_FLAGS) $($(GROUP)_CXXFLAGS) $(FILE_FLAGS_$(abspath $<)) -MMD -MP -c $< -o $@
$(OBJ_DIR)/%.S.o: %.S
@mkdir -p $(@D)
@$(if $(E),echo AS $<,)
$(CC) $(CFLAGS) $($(GROUP)_FLAGS) $(FILE_FLAGS_$(abspath $<)) -MMD -MP -c $< -o $@
clean:
rm -rf $(CORE_DIR)/obj
rm -f $(TARGET)
.PHONY: all clean
+2261
View File
File diff suppressed because it is too large. Load diff
+3 -2
View File
@@ -110,8 +110,9 @@ static void SetCurrentThreadNameViaApi(const char* name)
// If possible, also set via the newer API. On some versions of Server it needs to be manually // If possible, also set via the newer API. On some versions of Server it needs to be manually
// resolved. This API allows being able to observe the thread name even if a debugger wasn't // resolved. This API allows being able to observe the thread name even if a debugger wasn't
// attached when the name was set (see above link for more info). // attached when the name was set (see above link for more info).
static auto pSetThreadDescription = (decltype(&SetThreadDescription))GetProcAddress( using SetThreadDescriptionFn = HRESULT(WINAPI*)(HANDLE, PCWSTR);
GetModuleHandleA("kernel32"), "SetThreadDescription"); static auto pSetThreadDescription = reinterpret_cast<SetThreadDescriptionFn>(
GetProcAddress(GetModuleHandleA("kernel32"), "SetThreadDescription"));
if (pSetThreadDescription) if (pSetThreadDescription)
{ {
pSetThreadDescription(GetCurrentThread(), UTF8ToWString(name).c_str()); pSetThreadDescription(GetCurrentThread(), UTF8ToWString(name).c_str());
+4
View File
@@ -28,6 +28,10 @@ CONFIGRET WINAPI CM_Get_Device_Interface_PropertyW(
PBYTE Buffer, PBYTE Buffer,
PULONG BufferSize, PULONG BufferSize,
ULONG ulFlags); ULONG ulFlags);
CONFIGRET WINAPI CM_Register_Notification(PCM_NOTIFY_FILTER pFilter, PVOID pContext,
PCM_NOTIFY_CALLBACK pCallback,
PHCMNOTIFICATION pNotifyContext);
CONFIGRET WINAPI CM_Unregister_Notification(HCMNOTIFICATION NotifyContext);
} }
#define CM_Get_Device_Interface_Property CM_Get_Device_Interface_PropertyW #define CM_Get_Device_Interface_Property CM_Get_Device_Interface_PropertyW
#endif #endif
+19 -2
View File
@@ -46,20 +46,37 @@ DYN_FUNC_DECLARE(HidD_GetHidGuid);
DYN_FUNC_DECLARE(HidD_SetOutputReport); DYN_FUNC_DECLARE(HidD_SetOutputReport);
DYN_FUNC_DECLARE(HidD_GetProductString); DYN_FUNC_DECLARE(HidD_GetProductString);
#ifndef BLUETOOTH_SERVICE_ENABLE
// MinGW-w64 headers before 12.0 lack these, and declare the in-parameters of
// BluetoothFindFirstRadio and BluetoothSetServiceState without const. The
// pointer types follow the Windows SDK signatures.
#define BLUETOOTH_SERVICE_ENABLE 0x01
typedef BLUETOOTH_DEVICE_INFO BLUETOOTH_DEVICE_INFO_STRUCT;
using BluetoothAuthenticateDevice_t = DWORD(WINAPI*)(HWND, HANDLE, BLUETOOTH_DEVICE_INFO*, PWSTR,
ULONG);
using BluetoothFindFirstRadio_t = HBLUETOOTH_RADIO_FIND(WINAPI*)(const BLUETOOTH_FIND_RADIO_PARAMS*,
HANDLE*);
using BluetoothSetServiceState_t = DWORD(WINAPI*)(HANDLE, const BLUETOOTH_DEVICE_INFO*, const GUID*,
DWORD);
static BluetoothAuthenticateDevice_t pBluetoothAuthenticateDevice = nullptr;
static BluetoothFindFirstRadio_t pBluetoothFindFirstRadio = nullptr;
static BluetoothSetServiceState_t pBluetoothSetServiceState = nullptr;
#else
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4995) #pragma warning(disable : 4995)
DYN_FUNC_DECLARE(BluetoothAuthenticateDevice); DYN_FUNC_DECLARE(BluetoothAuthenticateDevice);
#pragma warning(pop) #pragma warning(pop)
DYN_FUNC_DECLARE(BluetoothFindFirstRadio);
DYN_FUNC_DECLARE(BluetoothSetServiceState);
#endif
DYN_FUNC_DECLARE(BluetoothAuthenticateDeviceEx); DYN_FUNC_DECLARE(BluetoothAuthenticateDeviceEx);
DYN_FUNC_DECLARE(BluetoothFindDeviceClose); DYN_FUNC_DECLARE(BluetoothFindDeviceClose);
DYN_FUNC_DECLARE(BluetoothFindFirstDevice); DYN_FUNC_DECLARE(BluetoothFindFirstDevice);
DYN_FUNC_DECLARE(BluetoothFindFirstRadio);
DYN_FUNC_DECLARE(BluetoothFindNextDevice); DYN_FUNC_DECLARE(BluetoothFindNextDevice);
DYN_FUNC_DECLARE(BluetoothFindNextRadio); DYN_FUNC_DECLARE(BluetoothFindNextRadio);
DYN_FUNC_DECLARE(BluetoothFindRadioClose); DYN_FUNC_DECLARE(BluetoothFindRadioClose);
DYN_FUNC_DECLARE(BluetoothGetRadioInfo); DYN_FUNC_DECLARE(BluetoothGetRadioInfo);
DYN_FUNC_DECLARE(BluetoothRemoveDevice); DYN_FUNC_DECLARE(BluetoothRemoveDevice);
DYN_FUNC_DECLARE(BluetoothSetServiceState);
DYN_FUNC_DECLARE(BluetoothEnumerateInstalledServices); DYN_FUNC_DECLARE(BluetoothEnumerateInstalledServices);
#undef DYN_FUNC_DECLARE #undef DYN_FUNC_DECLARE
+5
View File
@@ -37,6 +37,11 @@
#include <iphlpapi.h> #include <iphlpapi.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
// MinGW-w64 headers before 12.0 do not define this.
#ifndef NET_IFINDEX_UNSPECIFIED
#define NET_IFINDEX_UNSPECIFIED (NET_IFINDEX)(0)
#endif
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x)) #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x)) #define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
@@ -1048,6 +1048,8 @@ void InputBackend::PopulateDevices()
} // namespace ciface::Android } // namespace ciface::Android
// JNI entry points of the Android app; the libretro core has no Java side.
#ifndef __LIBRETRO__
extern "C" { extern "C" {
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
@@ -1228,3 +1230,4 @@ Java_org_dolphinemu_dolphinemu_features_input_model_ControllerInterface_getDevic
return CoreDeviceToJava(env, g_controller_interface.FindDevice(qualifier)); return CoreDeviceToJava(env, g_controller_interface.FindDevice(qualifier));
} }
} }
#endif
+9
View File
@@ -3,8 +3,17 @@
#pragma once #pragma once
#include <d3d12.h> #include <d3d12.h>
#include <d3d12sdklayers.h>
#include <wrl/client.h> #include <wrl/client.h>
// MinGW-w64 headers before 12.0 do not define these.
#ifndef D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT
#define D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT 32
#endif
#ifndef D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE
#define D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE 2048
#endif
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "VideoBackends/D3DCommon/D3DCommon.h" #include "VideoBackends/D3DCommon/D3DCommon.h"
@@ -27,7 +27,7 @@ std::unique_ptr<DXContext> g_dx_context;
static Common::DynamicLibrary s_d3d12_library; static Common::DynamicLibrary s_d3d12_library;
static PFN_D3D12_CREATE_DEVICE s_d3d12_create_device; static PFN_D3D12_CREATE_DEVICE s_d3d12_create_device;
static PFN_D3D12_GET_DEBUG_INTERFACE s_d3d12_get_debug_interface; static PFN_D3D12_GET_DEBUG_INTERFACE s_d3d12_get_debug_interface;
static PFN_D3D12_SERIALIZE_ROOT_SIGNATURE s_d3d12_serialize_root_signature; static decltype(&D3D12SerializeRootSignature) s_d3d12_serialize_root_signature;
DXContext::DXContext() = default; DXContext::DXContext() = default;
+4
View File
@@ -0,0 +1,4 @@
{
global: retro_*;
local: *;
};