mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-29 04:55:15 +00:00
Add POST_BUILD hook to copy libsodium-internals.so to where gradle wants it
Gradle should be able to do this itself but can't because it does cmake wrong (but don't worry, Google knows best).
This commit is contained in:
parent
728471f32a
commit
ad44bc961a
@ -18,8 +18,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
|||||||
# or SHARED, and provides the relative paths to its source code.
|
# or SHARED, and provides the relative paths to its source code.
|
||||||
# You can define multiple libraries, and CMake builds them for you.
|
# You can define multiple libraries, and CMake builds them for you.
|
||||||
# Gradle automatically packages shared libraries with your APK.
|
# Gradle automatically packages shared libraries with your APK.
|
||||||
set(STATIC_BUNDLE ON)
|
|
||||||
#set(BUILD_SHARED_LIBS ON CACHE BOOL "")
|
set(BUILD_SHARED_LIBS ON CACHE BOOL "")
|
||||||
add_subdirectory(../../../libsession-util libsession)
|
add_subdirectory(../../../libsession-util libsession)
|
||||||
|
|
||||||
add_library( # Sets the name of the library.
|
add_library( # Sets the name of the library.
|
||||||
@ -44,6 +44,13 @@ find_library( # Sets the name of the path variable.
|
|||||||
# you want CMake to locate.
|
# you want CMake to locate.
|
||||||
log)
|
log)
|
||||||
|
|
||||||
|
# Copy libsodium-internal.so into the library output dir manually because gradle invokes cmake in
|
||||||
|
# ways that doesn't properly do this:
|
||||||
|
get_target_property(sodium_lib_loc libsodium-internal IMPORTED_LOCATION)
|
||||||
|
add_custom_command(TARGET session_util POST_BUILD
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND} -E copy ${sodium_lib_loc} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||||
|
|
||||||
# Specifies libraries CMake should link to your target library. You
|
# Specifies libraries CMake should link to your target library. You
|
||||||
# can link multiple libraries, such as libraries you define in this
|
# can link multiple libraries, such as libraries you define in this
|
||||||
# build script, prebuilt third-party libraries, or system libraries.
|
# build script, prebuilt third-party libraries, or system libraries.
|
||||||
|
Loading…
Reference in New Issue
Block a user