Add libretro.h to the git repo.

To ease libretro compilation.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2021-11-21 20:20:37 +00:00
parent 7839aa0330
commit 682916415c
4 changed files with 3940 additions and 53 deletions

View file

@ -97,9 +97,6 @@ Video works, but the vertical flip is done in software.
Audio (speaker) works.
Must be manually configured:
``cmake -DLIBRETRO_COMMON_PATH=/path/to/libretro-common``
Easiest way to run from the ``build`` folder:
``retroarch -L source/frontends/libretro/applewin_libretro.so ../bin/MASTER.DSK``
@ -120,6 +117,18 @@ cmake -DCMAKE_BUILD_TYPE=RELEASE ..
make
```
### Frontend selection
There are 4 `cmake` variables to selectively enable frontends: `BUILD_APPLEN`, `BUILD_QAPPLE`, `BUILD_SA2` and `BUILD_LIBRETRO`.
Usage:
```
cmake -DBUILD_SA2=ON -DBUILD_LIBRETRO=ON ..
```
or use `cmake-gui` (if none is selected, they are all built).
### Fedora
On Fedora 35, from a fresh installation, install all packages from [fedora.list.txt](source/linux/fedora.list.txt).

View file

@ -1,52 +1,42 @@
# there is no simple package for libretro-common
# this requires user input
set(LIBRETRO_COMMON_PATH NONE CACHE PATH "path to libretro-common")
set(SOURCE_FILES
environment.cpp
libretro.cpp
rdirectsound.cpp
game.cpp
joypadbase.cpp
joypad.cpp
analog.cpp
rdirectsound.cpp
retroregistry.cpp
retroframe.cpp
)
if (EXISTS ${LIBRETRO_COMMON_PATH}/include/libretro.h)
message("Using LIBRETRO_COMMON_PATH=${LIBRETRO_COMMON_PATH}")
set(HEADER_FILES
environment.h
rdirectsound.h
game.h
joypadbase.h
joypad.h
analog.h
rdirectsound.h
retroregistry.h
retroframe.h
libretro-common/include/libretro.h
)
set(SOURCE_FILES
environment.cpp
libretro.cpp
rdirectsound.cpp
game.cpp
joypadbase.cpp
joypad.cpp
analog.cpp
rdirectsound.cpp
retroregistry.cpp
retroframe.cpp
)
add_library(applewin_libretro SHARED
${SOURCE_FILES}
${HEADER_FILES}
)
set(HEADER_FILES
environment.h
rdirectsound.h
game.h
joypadbase.h
joypad.h
analog.h
rdirectsound.h
retroregistry.h
retroframe.h
)
target_include_directories(applewin_libretro PRIVATE
libretro-common/include
)
add_library(applewin_libretro SHARED
${SOURCE_FILES}
${HEADER_FILES}
)
target_link_libraries(applewin_libretro PRIVATE
appleii
common2
)
target_include_directories(applewin_libretro PRIVATE
${LIBRETRO_COMMON_PATH}/include
)
target_link_libraries(applewin_libretro PRIVATE
appleii
common2
)
# just call it "applewin_libretro.so" as per libretro standard
set_target_properties(applewin_libretro PROPERTIES PREFIX "")
else()
message(WARNING "Bad LIBRETRO_COMMON_PATH=${LIBRETRO_COMMON_PATH}, skipping 'libretro' core")
endif()
# just call it "applewin_libretro.so" as per libretro standard
set_target_properties(applewin_libretro PROPERTIES PREFIX "")

File diff suppressed because it is too large Load diff

View file

@ -2,10 +2,8 @@
set -euxo pipefail
wget https://raw.githubusercontent.com/libretro/RetroArch/master/libretro-common/include/libretro.h -P libretro-common/include
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DLIBRETRO_COMMON_PATH=../libretro-common ..
cmake -DCMAKE_BUILD_TYPE=RELEASE ..
make -j 2