forked from MeloNX/MeloNX
Compile OpenSSL libraries during build
This commit is contained in:
parent
407c67a512
commit
5ef97ca444
@ -14,6 +14,9 @@ project("ryujinxjni")
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
|
||||
# libssl.so and libcrypto.so
|
||||
include(../../../../libryujinx/libs/OpenSSL.cmake)
|
||||
|
||||
FetchContent_Declare(
|
||||
adrenotools
|
||||
GIT_REPOSITORY https://github.com/bylaws/libadrenotools.git
|
||||
@ -38,6 +41,8 @@ add_library( # Sets the name of the library.
|
||||
string_helper.cpp
|
||||
ryujinx.cpp)
|
||||
|
||||
add_dependencies(ryujinxjni openssl)
|
||||
|
||||
# Searches for a specified prebuilt library and stores the path as a
|
||||
# variable. Because CMake includes system libraries in the search path by
|
||||
# default, you only need to specify the name of the public NDK library
|
||||
|
12
src/RyujinxAndroid/libryujinx/README.md
Normal file
12
src/RyujinxAndroid/libryujinx/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
# LibRyujinx Gradle project
|
||||
|
||||
## Libraries
|
||||
|
||||
The following native libraries will be compiled for this project.
|
||||
|
||||
### OpenSSL
|
||||
|
||||
Version: `3.2.1`
|
||||
|
||||
Make sure all the prerequisites are available on your system.
|
||||
You can read more about them [here](https://github.com/openssl/openssl/blob/openssl-3.2.1/INSTALL.md#prerequisites).
|
31
src/RyujinxAndroid/libryujinx/libs/OpenSSL.cmake
Normal file
31
src/RyujinxAndroid/libryujinx/libs/OpenSSL.cmake
Normal file
@ -0,0 +1,31 @@
|
||||
include(ExternalProject)
|
||||
|
||||
find_program(MAKE_COMMAND NAMES nmake make)
|
||||
|
||||
set(PROJECT_ENV "ANDROID_NDK_ROOT=${CMAKE_ANDROID_NDK}")
|
||||
|
||||
if (CMAKE_HOST_WIN32)
|
||||
find_program(PERL_COMMAND NAMES perl)
|
||||
set(PROJECT_CFG_PREFIX ${PERL_COMMAND})
|
||||
list(APPEND PROJECT_ENV "Path=${ANDROID_TOOLCHAIN_ROOT}\\bin;$ENV{Path}")
|
||||
elseif (CMAKE_HOST_UNIX)
|
||||
list(APPEND PROJECT_ENV "PATH=${ANDROID_TOOLCHAIN_ROOT}/bin:$ENV{PATH}")
|
||||
else ()
|
||||
message(WARNING "Host system (${CMAKE_HOST_SYSTEM_NAME}) not supported. Treating as unix.")
|
||||
list(APPEND PROJECT_ENV "PATH=${ANDROID_TOOLCHAIN_ROOT}/bin:$ENV{PATH}")
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(
|
||||
openssl
|
||||
GIT_REPOSITORY https://github.com/openssl/openssl.git
|
||||
GIT_TAG a7e992847de83aa36be0c399c89db3fb827b0be2 # openssl-3.2.1
|
||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${PROJECT_ENV}
|
||||
${PROJECT_CFG_PREFIX} <SOURCE_DIR>/Configure
|
||||
android-${CMAKE_ANDROID_ARCH}
|
||||
-D__ANDROID_API_=${CMAKE_SYSTEM_VERSION}
|
||||
--prefix=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||
--libdir=""
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} -E env ${PROJECT_ENV}
|
||||
${MAKE_COMMAND}
|
||||
INSTALL_COMMAND ${MAKE_COMMAND} install_runtime_libs
|
||||
)
|
Reference in New Issue
Block a user