Skip to content

Commit

Permalink
Add libretro.h to the git repo.
Browse files Browse the repository at this point in the history
To ease libretro compilation.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
  • Loading branch information
audetto committed Nov 21, 2021
1 parent 7839aa0 commit 6829164
Show file tree
Hide file tree
Showing 4 changed files with 3,945 additions and 58 deletions.
15 changes: 12 additions & 3 deletions linux.md
Expand Up @@ -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``

Expand All @@ -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).
Expand Down
94 changes: 42 additions & 52 deletions source/frontends/libretro/CMakeLists.txt
@@ -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")

if (EXISTS ${LIBRETRO_COMMON_PATH}/include/libretro.h)
message("Using LIBRETRO_COMMON_PATH=${LIBRETRO_COMMON_PATH}")

set(SOURCE_FILES
environment.cpp
libretro.cpp
rdirectsound.cpp
game.cpp
joypadbase.cpp
joypad.cpp
analog.cpp
rdirectsound.cpp
retroregistry.cpp
retroframe.cpp
)

set(HEADER_FILES
environment.h
rdirectsound.h
game.h
joypadbase.h
joypad.h
analog.h
rdirectsound.h
retroregistry.h
retroframe.h
)

add_library(applewin_libretro SHARED
${SOURCE_FILES}
${HEADER_FILES}
)

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()
set(SOURCE_FILES
environment.cpp
libretro.cpp
rdirectsound.cpp
game.cpp
joypadbase.cpp
joypad.cpp
analog.cpp
rdirectsound.cpp
retroregistry.cpp
retroframe.cpp
)

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
)

add_library(applewin_libretro SHARED
${SOURCE_FILES}
${HEADER_FILES}
)

target_include_directories(applewin_libretro PRIVATE
libretro-common/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 "")

0 comments on commit 6829164

Please sign in to comment.