From 9eec29847634d0cd0b3653cc0a9405d9406cbbf8 Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Fri, 24 May 2019 23:18:45 +0200 Subject: [PATCH] Add more targets to Wercker, including Windows Upgrade mutexes to cMutex to avoid issues on Windows Seems that we cannot include stdclass.h from a header without things going bad, due to some cyclic dependency in preprocessed stuff? --- core/input/gamepad_device.cpp | 18 +++++++++--------- core/input/gamepad_device.h | 2 -- shell/linux/Makefile | 2 -- wercker.yml | 16 +++++++++++----- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/core/input/gamepad_device.cpp b/core/input/gamepad_device.cpp index 82ccefdf8a..dc6cd95fe4 100644 --- a/core/input/gamepad_device.cpp +++ b/core/input/gamepad_device.cpp @@ -32,7 +32,7 @@ extern u8 rt[4], lt[4]; extern s8 joyx[4], joyy[4]; std::vector> GamepadDevice::_gamepads; -std::mutex GamepadDevice::_gamepads_mutex; +static cMutex _gamepads_mutex; bool GamepadDevice::gamepad_btn_input(u32 code, bool pressed) { @@ -238,21 +238,21 @@ bool GamepadDevice::find_mapping(const char *custom_mapping /* = NULL */) int GamepadDevice::GetGamepadCount() { - _gamepads_mutex.lock(); + _gamepads_mutex.Lock(); int count = _gamepads.size(); - _gamepads_mutex.unlock(); + _gamepads_mutex.Unlock(); return count; } std::shared_ptr GamepadDevice::GetGamepad(int index) { - _gamepads_mutex.lock(); + _gamepads_mutex.Lock(); std::shared_ptr dev; if (index >= 0 && index < _gamepads.size()) dev = _gamepads[index]; else dev = NULL; - _gamepads_mutex.unlock(); + _gamepads_mutex.Unlock(); return dev; } @@ -295,21 +295,21 @@ void GamepadDevice::Register(std::shared_ptr gamepad) if (maple_port != 12345) gamepad->set_maple_port(maple_port); - _gamepads_mutex.lock(); + _gamepads_mutex.Lock(); _gamepads.push_back(gamepad); - _gamepads_mutex.unlock(); + _gamepads_mutex.Unlock(); } void GamepadDevice::Unregister(std::shared_ptr gamepad) { gamepad->save_mapping(); - _gamepads_mutex.lock(); + _gamepads_mutex.Lock(); for (auto it = _gamepads.begin(); it != _gamepads.end(); it++) if (*it == gamepad) { _gamepads.erase(it); break; } - _gamepads_mutex.unlock(); + _gamepads_mutex.Unlock(); } void GamepadDevice::SaveMaplePorts() diff --git a/core/input/gamepad_device.h b/core/input/gamepad_device.h index 92a75692d2..9094a5e722 100644 --- a/core/input/gamepad_device.h +++ b/core/input/gamepad_device.h @@ -19,7 +19,6 @@ #pragma once #include -#include #include "types.h" #include "mapping.h" @@ -89,5 +88,4 @@ class GamepadDevice float _dead_zone = 0.1f; static std::vector> _gamepads; - static std::mutex _gamepads_mutex; }; diff --git a/shell/linux/Makefile b/shell/linux/Makefile index 355903c090..dbd5381297 100644 --- a/shell/linux/Makefile +++ b/shell/linux/Makefile @@ -255,8 +255,6 @@ else ifneq (,$(findstring win32,$(platform))) LDFLAGS += -static-libgcc -static-libstdc++ -Wl,-subsystem,windows LIBS := -lopengl32 -lwinmm -lgdi32 -lwsock32 -ldsound -lcomctl32 -lcomdlg32 -lxinput -liphlpapi PLATFORM_EXT := exe - CC = gcc - CXX = g++ ifeq ($(WITH_DYNAREC), x86) X86_REC := 1 LDFLAGS += -m32 diff --git a/wercker.yml b/wercker.yml index 22d2c72dba..f0d1bc0cff 100644 --- a/wercker.yml +++ b/wercker.yml @@ -4,10 +4,16 @@ build: steps: - script: name: install-dependencies - code: sudo apt-get clean && sudo apt-get update && sudo apt-get install -y build-essential pkgconf libasound2-dev libgl1-mesa-dev libx11-dev libudev-dev git + code: sudo dpkg --add-architecture i386 && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y build-essential pkgconf libasound2-dev libgl1-mesa-dev libx11-dev libudev-dev git && sudo apt-get install -y libasound2-dev:i386 libgl1-mesa-dev:i386 libx11-dev:i386 libudev-dev:i386 libc6:i386 g++-multilib gcc-multilib && sudo apt-get install -y g++-mingw-w64-x86-64 mingw-w64-x86-64-dev libz-mingw-w64-dev libnpth-mingw-w64-dev - script: - name: gcc-version - code: gcc --version + name: toolchain info + code: gcc --version && x86_64-w64-mingw32-gcc --version - script: - name: reicast x64 build - code: make -C shell/linux platform=x64 + name: reicast Linux x64 build + code: make -C shell/linux -j `nproc` platform=x64 + - script: + name: reicast Linux x86 build + code: make -C shell/linux -j `nproc` platform=x86 + - script: + name: reicast Windows x64 (MinGW) build + code: make -C shell/linux -j `nproc` platform=win32 CC_PREFIX=x86_64-w64-mingw32-