Skip to content

Commit

Permalink
Add libretro common dep
Browse files Browse the repository at this point in the history
Replace libretro.h with libretro-common/libretro.h
  • Loading branch information
NikosSiak committed Mar 20, 2022
1 parent a9bb311 commit 262c7b3
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 3,914 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ project(game.libretro)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

find_package(Kodi REQUIRED)
find_package(LibretroCommon REQUIRED)
find_package(TinyXML REQUIRED)
find_package(Rcheevos REQUIRED)

include_directories(${KODI_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src
${LIBRETRO_COMMON_INCLUDE_DIRS}
${TINYXML_INCLUDE_DIRS}
${RCHEEVOS_INCLUDE_DIRS})

Expand Down Expand Up @@ -78,7 +80,6 @@ set(LIBRETRO_HEADERS src/GameInfoLoader.h
src/libretro/LibretroDefines.h
src/libretro/LibretroDLL.h
src/libretro/LibretroEnvironment.h
src/libretro/libretro.h
src/libretro/LibretroResources.h
src/libretro/LibretroTranslator.h
src/libretro/MemoryMap.h
Expand Down
25 changes: 25 additions & 0 deletions cmake/FindLibretroCommon.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# FindLibretroCommon.cmake
# -------
# Finds the libretro-common headers
#
# This will define the following variables:
#
# LIBRETRO_COMMON_FOUND - libretro-common was found
# LIBRETRO_COMMON_INCLUDE_DIRS - the libretro include directory containing libretro.h
#

find_path(LIBRETRO_COMMON_INCLUDE_DIR NAMES libretro.h
PATH_SUFFIXES libretro-common)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
LibretroCommon
REQUIRED_VARS LIBRETRO_COMMON_INCLUDE_DIR
)

if(LibretroCommon_FOUND)
set(LIBRETRO_COMMON_FOUND true)
set(LIBRETRO_COMMON_INCLUDE_DIRS ${LIBRETRO_COMMON_INCLUDE_DIR})
endif()

mark_as_advanced(LIBRETRO_COMMON_INCLUDE_DIR)
7 changes: 7 additions & 0 deletions depends/common/libretro-common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.0)
project(libretro-common)

INSTALL(
DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
)
1 change: 1 addition & 0 deletions depends/common/libretro-common/libretro-common.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
042986fad22dc37188df7a186d17a258edfe8e552353f9b509a47418e8dfa623
1 change: 1 addition & 0 deletions depends/common/libretro-common/libretro-common.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libretro-common https://github.com/libretro/libretro-common/archive/50c15a88eb741cbe675743a282d8cc4c89421e3f.tar.gz
2 changes: 1 addition & 1 deletion src/GameInfoLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#pragma once

#include "libretro/libretro.h"
#include "libretro-common/libretro.h"

#include <stdint.h>
#include <string>
Expand Down
1 change: 0 additions & 1 deletion src/cheevos/Cheevos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "libretro/LibretroEnvironment.h"
#include "libretro/MemoryMap.h"
#include "libretro/libretro.h"
#include "rcheevos/rconsoles.h"
#include "rcheevos/rhash.h"
#include "rcheevos/rurl.h"
Expand Down
2 changes: 1 addition & 1 deletion src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "input/ButtonMapper.h"
#include "input/ControllerTopology.h"
#include "input/InputManager.h"
#include "libretro/libretro.h"
#include "libretro-common/libretro.h"
#include "libretro/LibretroEnvironment.h"
#include "log/Log.h"
#include "log/LogAddon.h"
Expand Down
2 changes: 1 addition & 1 deletion src/input/ButtonMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "libretro/LibretroDLL.h"
#include "libretro/LibretroEnvironment.h"
#include "libretro/LibretroTranslator.h"
#include "libretro/libretro.h"
#include "libretro-common/libretro.h"
#include "log/Log.h"

#include <tinyxml.h>
Expand Down
2 changes: 1 addition & 1 deletion src/input/DefaultControllerTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "DefaultControllerTranslator.h"
#include "DefaultControllerDefines.h"
#include "libretro/libretro.h"
#include "libretro-common/libretro.h"

using namespace LIBRETRO;

Expand Down
2 changes: 1 addition & 1 deletion src/input/DefaultKeyboardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "DefaultKeyboardTranslator.h"
#include "DefaultKeyboardDefines.h"
#include "libretro/libretro.h"
#include "libretro-common/libretro.h"

using namespace LIBRETRO;

Expand Down
2 changes: 1 addition & 1 deletion src/input/InputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "LibretroDevice.h"
#include "LibretroDeviceInput.h"
#include "libretro/ClientBridge.h"
#include "libretro/libretro.h"
#include "libretro-common/libretro.h"
#include "libretro/LibretroEnvironment.h"
#include "libretro/LibretroTranslator.h"
#include "log/Log.h"
Expand Down
2 changes: 1 addition & 1 deletion src/input/LibretroDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "InputDefinitions.h"
#include "LibretroDeviceInput.h"
#include "libretro/LibretroTranslator.h"
#include "libretro/libretro.h"
#include "libretro-common/libretro.h"
#include "log/Log.h"

#include <tinyxml.h>
Expand Down
2 changes: 1 addition & 1 deletion src/input/LibretroDeviceInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "libretro/ClientBridge.h"
#include "libretro/LibretroEnvironment.h"
#include "libretro/LibretroTranslator.h"
#include "libretro/libretro.h"
#include "libretro-common/libretro.h"
#include "log/Log.h"

using namespace LIBRETRO;
Expand Down
2 changes: 1 addition & 1 deletion src/libretro/LibretroEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "LibretroEnvironment.h"
#include "ClientBridge.h"
#include "FrontendBridge.h"
#include "libretro.h"
#include "libretro-common/libretro.h"
#include "LibretroDLL.h"
#include "LibretroTranslator.h"
#include "input/InputManager.h"
Expand Down
1 change: 0 additions & 1 deletion src/libretro/LibretroEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
class CGameLibRetro;

struct retro_game_geometry;
struct retro_memory_map_kodi;

namespace LIBRETRO
{
Expand Down
1 change: 0 additions & 1 deletion src/libretro/MemoryMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include "MemoryMap.h"
#include "libretro.h"

using namespace LIBRETRO;

Expand Down
8 changes: 6 additions & 2 deletions src/libretro/MemoryMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
#pragma once

#include <vector>
#include "libretro-common/libretro.h"

struct retro_memory_map;
struct retro_memory_descriptor_kodi;
struct retro_memory_descriptor_kodi
{
retro_memory_descriptor descriptor;
size_t disconnectMask;
};

namespace LIBRETRO
{
Expand Down
Loading

0 comments on commit 262c7b3

Please sign in to comment.