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. Audio (speaker) works.
Must be manually configured:
``cmake -DLIBRETRO_COMMON_PATH=/path/to/libretro-common``
Easiest way to run from the ``build`` folder: Easiest way to run from the ``build`` folder:
``retroarch -L source/frontends/libretro/applewin_libretro.so ../bin/MASTER.DSK`` ``retroarch -L source/frontends/libretro/applewin_libretro.so ../bin/MASTER.DSK``
@ -120,6 +117,18 @@ cmake -DCMAKE_BUILD_TYPE=RELEASE ..
make 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 ### Fedora
On Fedora 35, from a fresh installation, install all packages from [fedora.list.txt](source/linux/fedora.list.txt). 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 set(SOURCE_FILES
# this requires user input environment.cpp
set(LIBRETRO_COMMON_PATH NONE CACHE PATH "path to libretro-common") 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) set(HEADER_FILES
message("Using LIBRETRO_COMMON_PATH=${LIBRETRO_COMMON_PATH}") 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 add_library(applewin_libretro SHARED
environment.cpp ${SOURCE_FILES}
libretro.cpp ${HEADER_FILES}
rdirectsound.cpp )
game.cpp
joypadbase.cpp
joypad.cpp
analog.cpp
rdirectsound.cpp
retroregistry.cpp
retroframe.cpp
)
set(HEADER_FILES target_include_directories(applewin_libretro PRIVATE
environment.h libretro-common/include
rdirectsound.h )
game.h
joypadbase.h
joypad.h
analog.h
rdirectsound.h
retroregistry.h
retroframe.h
)
add_library(applewin_libretro SHARED target_link_libraries(applewin_libretro PRIVATE
${SOURCE_FILES} appleii
${HEADER_FILES} common2
) )
target_include_directories(applewin_libretro PRIVATE # just call it "applewin_libretro.so" as per libretro standard
${LIBRETRO_COMMON_PATH}/include set_target_properties(applewin_libretro PROPERTIES PREFIX "")
)
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()

File diff suppressed because it is too large Load diff

View file

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