Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTG committed Jul 25, 2024
2 parents fe062ef + f759fd4 commit 904743f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ libretro-build-ios-arm64:
- .libretro-ios-cmake-arm64
- .core-defs
variables:
CORE_ARGS: --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=13
CORE_ARGS: --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=13 -DBUILD_AS_SHARED_LIBRARY=ON
IOS_MINVER: "13.0"
CXXFLAGS: -Wno-deprecated-declarations -Wno-unknown-attributes

Expand All @@ -145,6 +145,6 @@ libretro-build-tvos-arm64:
- .libretro-tvos-cmake-arm64
- .core-defs
variables:
CORE_ARGS: --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=TVOS -DDEPLOYMENT_TARGET=13
CORE_ARGS: --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=TVOS -DDEPLOYMENT_TARGET=13 -DBUILD_AS_SHARED_LIBRARY=ON
IOS_MINVER: "13.0"
CXXFLAGS: -Wno-deprecated-declarations -Wno-unknown-attributes
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ option(ENABLE_THREADED_RENDERER "Enable the threaded software renderer." ON)
option(BUILD_TESTING "Build test suite." OFF)
include(CTest)

# iOS/tvOS want the library built SHARED, other platforms have been happy with MODULE
option(BUILD_AS_SHARED_LIBRARY "Allow for both linking and loading" OFF)

add_subdirectory(src/libretro)
include(cmake/GenerateAttributions.cmake)

Expand Down
10 changes: 8 additions & 2 deletions src/libretro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)

include(embed-binaries)

add_library(melondsds_libretro MODULE
if (BUILD_AS_SHARED_LIBRARY)
set(LIBRARY_TYPE SHARED)
else ()
set(LIBRARY_TYPE MODULE)
endif ()

add_library(melondsds_libretro ${LIBRARY_TYPE}
buffer.cpp
buffer.hpp
config/config.hpp
Expand Down Expand Up @@ -256,4 +262,4 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Defining DEBUG in melondsds_libretro and libretro-common targets")
target_compile_definitions(melondsds_libretro PUBLIC DEBUG)
target_compile_definitions(libretro-common PUBLIC DEBUG)
endif ()
endif ()

0 comments on commit 904743f

Please sign in to comment.