From 062eabc25ee6edf789aa14bf75d2bb2fd734814b Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Wed, 5 Oct 2022 13:39:52 -0600 Subject: [PATCH] update raphnet --- simple64-input-raphnetraw/.gitignore | 2 +- simple64-input-raphnetraw/CMakeLists.txt | 47 +++++++++++++++++++ .../projects/unix/Makefile | 12 ++--- 3 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 simple64-input-raphnetraw/CMakeLists.txt diff --git a/simple64-input-raphnetraw/.gitignore b/simple64-input-raphnetraw/.gitignore index cb2cbd5..2aaf102 100644 --- a/simple64-input-raphnetraw/.gitignore +++ b/simple64-input-raphnetraw/.gitignore @@ -2,4 +2,4 @@ *.so *.o *.swp -/projects/unix/_obj*/ +build/ diff --git a/simple64-input-raphnetraw/CMakeLists.txt b/simple64-input-raphnetraw/CMakeLists.txt new file mode 100644 index 0000000..bdf50ae --- /dev/null +++ b/simple64-input-raphnetraw/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.20) + +project(simple64-input-raphnetraw LANGUAGES C) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(CheckIPOSupported) +check_ipo_supported(RESULT ENABLE_IPO) +if(ENABLE_IPO) + message("Interprocedural optimizations enabled") +endif(ENABLE_IPO) + +if(ENABLE_IPO AND (CMAKE_BUILD_TYPE STREQUAL "Release")) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) +endif() + +include_directories(../mupen64plus-core/src/api) + +find_package(PkgConfig REQUIRED) + +add_library(simple64-input-raphnetraw SHARED + src/plugin_front.c + src/plugin_back.c + src/gcn64lib.c + src/gcn64.c + src/hexdump.c +) + +if (WIN32) + target_sources(simple64-input-raphnetraw PRIVATE + src/osal_dynamiclib_win32.c + ) + pkg_check_modules(HIDAPI REQUIRED hidapi) +endif (WIN32) + +if (UNIX) + target_sources(simple64-input-raphnetraw PRIVATE + src/osal_dynamiclib_unix.c + ) + pkg_check_modules(HIDAPI REQUIRED hidapi-hidraw) +endif (UNIX) + +set_target_properties(simple64-input-raphnetraw PROPERTIES PREFIX "") +target_compile_options(simple64-input-raphnetraw PRIVATE -march=x86-64-v3 ${HIDAPI_CFLAGS}) +target_link_options(simple64-input-raphnetraw PRIVATE -march=x86-64-v3) +target_link_libraries(simple64-input-raphnetraw PRIVATE ${HIDAPI_LIBRARIES}) diff --git a/simple64-input-raphnetraw/projects/unix/Makefile b/simple64-input-raphnetraw/projects/unix/Makefile index bb0327d..9ee7226 100644 --- a/simple64-input-raphnetraw/projects/unix/Makefile +++ b/simple64-input-raphnetraw/projects/unix/Makefile @@ -128,10 +128,10 @@ ifeq ($(OS), OSX) ifeq ($(CPU), X86) ifeq ($(ARCH_DETECTED), 64BITS) - CFLAGS += -arch x86_64 -mmacosx-version-min=11.0 -isysroot $(OSX_SDK_PATH) + CFLAGS += -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH) LDLIBS += -ldl else - CFLAGS += -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=11.0 -isysroot $(OSX_SDK_PATH) + CFLAGS += -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH) LDLIBS += -ldl -read_only_relocs suppress endif endif @@ -252,16 +252,16 @@ OBJDIRS = $(dir $(OBJECTS)) $(shell $(MKDIR) $(OBJDIRS)) # build targets -TARGET = simple64-input-raphnetraw$(POSTFIX).$(SO_EXTENSION) +TARGET = mupen64plus-input-raphnetraw$(POSTFIX).$(SO_EXTENSION) targets: - @echo "simple64-input-raphnetraw makefile. " + @echo "Mupen64Plus-input-raphnetraw makefile. " @echo " Targets:" @echo " all == Build Mupen64Plus raphnetraw input plugin" @echo " clean == remove object files" @echo " rebuild == clean and re-build all" - @echo " install == Install simple64 raphnetraw input plugin" - @echo " uninstall == Uninstall simple64 raphnetraw input plugin" + @echo " install == Install Mupen64Plus raphnetraw input plugin" + @echo " uninstall == Uninstall Mupen64Plus raphnetraw input plugin" @echo " Options:" @echo " BITS=32 == build 32-bit binaries on 64-bit machine" @echo " APIDIR=path == path to find Mupen64Plus Core headers"