early-access version 1736

This commit is contained in:
pineappleEA 2021-05-31 21:32:39 +02:00
parent 9d9ad073aa
commit 8048635648
3 changed files with 217 additions and 133 deletions

View File

@ -426,7 +426,7 @@ if(NOT APPLE)
endif()
if (NOT LIBUSB_FOUND)
add_subdirectory(externals/libusb)
set(LIBUSB_INCLUDE_DIR "")
set(LIBUSB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/libusb/libusb/libusb")
set(LIBUSB_LIBRARIES usb)
endif()

View File

@ -1,7 +1,7 @@
yuzu emulator early access
=============
This is the source code for early-access 1735.
This is the source code for early-access 1736.
## Legal Notice

View File

@ -1,3 +1,86 @@
if (MINGW)
# The MinGW toolchain for some reason doesn't work with this CMakeLists file after updating to
# 1.0.24, so we do it the old-fashioned way for now. We may want to move native Linux toolchains
# to here, too (TODO lat9nq?).
set(LIBUSB_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/libusb")
set(LIBUSB_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libusb")
# Workarounds for MSYS/MinGW
if (MSYS)
# CMake on Windows passes `C:/`, but we need `/C/` or `/c/` to use `configure`
string(REPLACE ":/" "/" LIBUSB_SRC_DIR "${LIBUSB_SRC_DIR}")
set(LIBUSB_SRC_DIR "/${LIBUSB_SRC_DIR}")
# And now that we are using /C/ for srcdir but everything else is using C:/, we need to
# compile everything in the source directory, else `configure` won't think the build
# environment is sane.
set(LIBUSB_PREFIX "${LIBUSB_SRC_DIR}")
endif()
set(LIBUSB_CONFIGURE "${LIBUSB_SRC_DIR}/configure")
set(LIBUSB_MAKEFILE "${LIBUSB_PREFIX}/Makefile")
set(LIBUSB_LIBRARY "${LIBUSB_PREFIX}/libusb/.libs/libusb-1.0.dll.a")
set(LIBUSB_SHARED_LIBRARY "${LIBUSB_PREFIX}/libusb/.libs/libusb-1.0.dll")
set(LIBUSB_SHARED_LIBRARY_DEST "${CMAKE_BINARY_DIR}/bin/libusb-1.0.dll")
# Causes "externals/libusb/libusb/libusb/os/windows_winusb.c:1427:2: error: conversion to non-scalar type requested", so cannot statically link it for now.
# set(LIBUSB_CFLAGS "-DGUID_DEVINTERFACE_USB_DEVICE=\\(GUID\\){0xA5DCBF10,0x6530,0x11D2,{0x90,0x1F,0x00,0xC0,0x4F,0xB9,0x51,0xED}}")
make_directory("${LIBUSB_PREFIX}")
add_custom_command(
OUTPUT
"${LIBUSB_LIBRARY}"
COMMAND
make
WORKING_DIRECTORY
"${LIBUSB_PREFIX}"
)
# We may use this path for other GNU toolchains, so put all of the MinGW-specific stuff here
if (MINGW)
set(LIBUSB_CONFIGURE_ARGS --host=x86_64-w64-mingw32 --build=x86_64-windows)
endif()
add_custom_command(
OUTPUT
"${LIBUSB_MAKEFILE}"
COMMAND
# /bin/env
# CFLAGS="${LIBUSB_CFLAGS}"
/bin/sh "${LIBUSB_CONFIGURE}"
${LIBUSB_CONFIGURE_ARGS}
--srcdir="${LIBUSB_SRC_DIR}"
WORKING_DIRECTORY
"${LIBUSB_PREFIX}"
)
add_custom_command(
OUTPUT
"${LIBUSB_CONFIGURE}"
COMMAND
/bin/sh "${LIBUSB_SRC_DIR}/bootstrap.sh"
WORKING_DIRECTORY
"${LIBUSB_SRC_DIR}"
)
add_custom_command(
OUTPUT
"${LIBUSB_SHARED_LIBRARY_DEST}"
COMMAND
/bin/cp "${LIBUSB_SHARED_LIBRARY}" "${LIBUSB_SHARED_LIBRARY_DEST}"
)
add_custom_target(usb-bootstrap ALL DEPENDS "${LIBUSB_CONFIGURE}")
add_custom_target(usb-configure ALL DEPENDS "${LIBUSB_MAKEFILE}" usb-bootstrap)
add_custom_target(usb-build ALL DEPENDS "${LIBUSB_LIBRARY}" usb-configure)
# Workaround since static linking didn't work out -- We need to copy the DLL to the bin directory
add_custom_target(usb-copy ALL DEPENDS "${LIBUSB_SHARED_LIBRARY_DEST}" usb-build)
# Make `usb` alias to LIBUSB_LIBRARY
add_library(usb INTERFACE)
target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARY}")
else() # MINGW
# Ensure libusb compiles with UTF-8 encoding on MSVC
if(MSVC)
add_compile_options(/utf-8)
@ -12,7 +95,7 @@ add_library(usb STATIC EXCLUDE_FROM_ALL
libusb/libusb/strerror.c
libusb/libusb/sync.c
)
set_target_properties(usb PROPERTIES VERSION 1.0.23)
set_target_properties(usb PROPERTIES VERSION 1.0.24)
if(WIN32)
target_include_directories(usb
BEFORE
@ -153,3 +236,4 @@ check_include_files(sys/timerfd.h USBI_TIMERFD_AVAILABLE)
configure_file(config.h.in config.h)
endif() # MINGW