Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old variable in CMake gko_rename_cache #1471

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cmake/rename.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ macro(gko_rename_cache deprecated actual type doc_string)
message("actual ${actual} and deprecated ${deprecated}")
if("${${actual}}" STREQUAL "${${deprecated}}")
# They are the same, so only throw warning
message(WARNING "${deprecated} was deprecated, please only use ${actual} instead.")
message(WARNING "${deprecated} was deprecated, please only use ${actual} instead. We removed the old variable.")
unset(${deprecated} CACHE)
else()
# They are different
message(FATAL_ERROR "Both ${deprecated} and ${actual} were specified differently, please only use ${actual} instead.")
endif()
else()
# Only set `deprecated`, move it to `actual`.
message(WARNING "${deprecated} was deprecated, please use ${actual} instead. "
"We copy ${${deprecated}} to ${actual}")
"We copied ${${deprecated}} to ${actual} and removed the old variable.")
set(${actual} ${${deprecated}} CACHE ${type} "${doc_string}")
unset(${deprecated} CACHE)
endif()
endif()
endmacro()
endmacro()
Loading