Skip to content

Commit 904743f

Browse files
committed
Merge branch 'refs/heads/main' into dev
2 parents fe062ef + f759fd4 commit 904743f

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ libretro-build-ios-arm64:
135135
- .libretro-ios-cmake-arm64
136136
- .core-defs
137137
variables:
138-
CORE_ARGS: --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=13
138+
CORE_ARGS: --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=13 -DBUILD_AS_SHARED_LIBRARY=ON
139139
IOS_MINVER: "13.0"
140140
CXXFLAGS: -Wno-deprecated-declarations -Wno-unknown-attributes
141141

@@ -145,6 +145,6 @@ libretro-build-tvos-arm64:
145145
- .libretro-tvos-cmake-arm64
146146
- .core-defs
147147
variables:
148-
CORE_ARGS: --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=TVOS -DDEPLOYMENT_TARGET=13
148+
CORE_ARGS: --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=TVOS -DDEPLOYMENT_TARGET=13 -DBUILD_AS_SHARED_LIBRARY=ON
149149
IOS_MINVER: "13.0"
150150
CXXFLAGS: -Wno-deprecated-declarations -Wno-unknown-attributes

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ option(ENABLE_THREADED_RENDERER "Enable the threaded software renderer." ON)
104104
option(BUILD_TESTING "Build test suite." OFF)
105105
include(CTest)
106106

107+
# iOS/tvOS want the library built SHARED, other platforms have been happy with MODULE
108+
option(BUILD_AS_SHARED_LIBRARY "Allow for both linking and loading" OFF)
109+
107110
add_subdirectory(src/libretro)
108111
include(cmake/GenerateAttributions.cmake)
109112

src/libretro/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
33

44
include(embed-binaries)
55

6-
add_library(melondsds_libretro MODULE
6+
if (BUILD_AS_SHARED_LIBRARY)
7+
set(LIBRARY_TYPE SHARED)
8+
else ()
9+
set(LIBRARY_TYPE MODULE)
10+
endif ()
11+
12+
add_library(melondsds_libretro ${LIBRARY_TYPE}
713
buffer.cpp
814
buffer.hpp
915
config/config.hpp
@@ -256,4 +262,4 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
256262
message(STATUS "Defining DEBUG in melondsds_libretro and libretro-common targets")
257263
target_compile_definitions(melondsds_libretro PUBLIC DEBUG)
258264
target_compile_definitions(libretro-common PUBLIC DEBUG)
259-
endif ()
265+
endif ()

0 commit comments

Comments
 (0)