mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
[cmake][android] symlink external libs instead of copying them
saves some disk space, Gradle will package actual files anyway
This commit is contained in:
@@ -736,9 +736,7 @@ if(ANDROID)
|
|||||||
|
|
||||||
if(ANDROID_STL MATCHES "_shared$")
|
if(ANDROID_STL MATCHES "_shared$")
|
||||||
set(stlLibName "${CMAKE_SHARED_LIBRARY_PREFIX}${ANDROID_STL}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set(stlLibName "${CMAKE_SHARED_LIBRARY_PREFIX}${ANDROID_STL}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
install(FILES "${CMAKE_SYSROOT}/usr/lib/${ANDROID_SYSROOT_LIB_SUBDIR}/${stlLibName}"
|
vcmi_install_libs_symlink("${CMAKE_SYSROOT}/usr/lib/${ANDROID_SYSROOT_LIB_SUBDIR}/${stlLibName}")
|
||||||
DESTINATION ${LIB_DIR}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
install(DIRECTORY config DESTINATION ${DATA_DIR})
|
install(DIRECTORY config DESTINATION ${DATA_DIR})
|
||||||
|
|||||||
@@ -118,6 +118,18 @@ function(vcmi_print_git_commit_hash)
|
|||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# install(FILES) of shared libs but using symlink instead of copying
|
||||||
|
function(vcmi_install_libs_symlink libs)
|
||||||
|
install(CODE "
|
||||||
|
foreach(lib ${libs})
|
||||||
|
cmake_path(GET lib FILENAME filename)
|
||||||
|
file(CREATE_LINK \${lib} \"\${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/\${filename}\"
|
||||||
|
COPY_ON_ERROR SYMBOLIC
|
||||||
|
)
|
||||||
|
endforeach()
|
||||||
|
")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# install dependencies from Conan, CONAN_RUNTIME_LIBS_FILE is set in conanfile.py
|
# install dependencies from Conan, CONAN_RUNTIME_LIBS_FILE is set in conanfile.py
|
||||||
function(vcmi_install_conan_deps)
|
function(vcmi_install_conan_deps)
|
||||||
if(NOT USING_CONAN)
|
if(NOT USING_CONAN)
|
||||||
@@ -125,7 +137,11 @@ function(vcmi_install_conan_deps)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(STRINGS "${CONAN_RUNTIME_LIBS_FILE}" runtimeLibs)
|
file(STRINGS "${CONAN_RUNTIME_LIBS_FILE}" runtimeLibs)
|
||||||
install(FILES ${runtimeLibs} DESTINATION ${LIB_DIR})
|
if(ANDROID)
|
||||||
|
vcmi_install_libs_symlink("${runtimeLibs}")
|
||||||
|
else()
|
||||||
|
install(FILES ${runtimeLibs} DESTINATION ${LIB_DIR})
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(vcmi_deploy_qt deployQtToolName deployQtOptions)
|
function(vcmi_deploy_qt deployQtToolName deployQtOptions)
|
||||||
|
|||||||
Reference in New Issue
Block a user