mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
Meta: Move remove_unicode_data_if_version_changed to utils.cmake
This function will be used by the time zone database parser. Move it to the common utilities file, and rename it remove_path_if_version_changed to be more generic.
This commit is contained in:
parent
a70e029236
commit
d5f14b5ff9
2 changed files with 21 additions and 19 deletions
|
@ -158,3 +158,20 @@ function(link_with_unicode_data target)
|
|||
target_link_libraries("${target}" LibUnicodeData)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(remove_path_if_version_changed version version_file cache_path)
|
||||
set(version_differs YES)
|
||||
|
||||
if (EXISTS "${version_file}")
|
||||
file(STRINGS "${version_file}" active_version)
|
||||
if (version STREQUAL active_version)
|
||||
set(version_differs NO)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (version_differs)
|
||||
message(STATUS "Removing outdated ${cache_path} for version ${version}")
|
||||
file(REMOVE_RECURSE "${cache_path}")
|
||||
file(WRITE "${version_file}" "${version}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue