mirror of
https://github.com/mudita/MuditaOS.git
synced 2025-12-23 22:17:57 -05:00
* Fix for the issue that resulted in race condition between target creating and populating databases and the one copying created databases to required directories. The issue was caused by lack of dependency between those targets, what allowed CMake engine to parallelize them. As a result, databases were copied before their creation has been finished, what resulted in weird discrepancies in databases content and occasional rsync errors. * Removed unused multicomp_install function. * Refactored DB tests readContent helper.
64 lines
2.0 KiB
CMake
64 lines
2.0 KiB
CMake
# Both these functions use the same tool - please mind that first function downloads single asset, whereas second one multiple ones
|
|
|
|
function(download_asset_release asset_name_in asset_name_out asset_repo asset_version cache_dir)
|
|
add_custom_command(OUTPUT ${asset_repo}
|
|
COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/download_asset.py
|
|
--cache_dir ${cache_dir}
|
|
github
|
|
--owner mudita
|
|
--repository ${asset_repo}
|
|
--install_dir ${SYSROOT_BIN_PATH}
|
|
download
|
|
--name_in ${asset_name_in}
|
|
--name_out ${asset_name_out}
|
|
--product ${PRODUCT}
|
|
--version ${asset_version}
|
|
COMMENT "Downloading ${asset_name_out} to install dir: ${CMAKE_BINARY_DIR}"
|
|
)
|
|
|
|
add_custom_target(${asset_name_out}-target DEPENDS ${asset_repo})
|
|
endfunction()
|
|
|
|
function(download_asset_release_json
|
|
target
|
|
json
|
|
install_path
|
|
repository
|
|
version
|
|
cache_dir
|
|
)
|
|
add_custom_target(
|
|
${target}
|
|
COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/download_asset.py
|
|
--cache_dir ${cache_dir}
|
|
github
|
|
--owner mudita
|
|
--repository ${repository}
|
|
--install_dir ${install_path}
|
|
download
|
|
--json ${json}
|
|
--version ${version}
|
|
--product ${PRODUCT}
|
|
COMMENT "Downloading ${target} from ${json} for ${PRODUCT} to install dir: ${install_path}"
|
|
)
|
|
endfunction()
|
|
|
|
function(download_asset_json
|
|
target
|
|
json
|
|
install_path
|
|
repository
|
|
cache_dir)
|
|
add_custom_target(${target}
|
|
COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/download_asset.py
|
|
--cache_dir ${cache_dir}
|
|
github
|
|
--owner mudita
|
|
--repository ${repository}
|
|
--install_dir ${install_path}
|
|
json
|
|
--json ${json}
|
|
COMMENT "Download ${target} binary assets listed in ${json} for ${PRODUCT} to install dir: ${install_path}"
|
|
)
|
|
endfunction()
|