mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Strip newline when ingesting version.txt (#36002)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36002 Test Plan: Run cmake and observe there are no warning in stdout nor in `CMakeCache.txt` Differential Revision: D20872854 Pulled By: malfet fbshipit-source-id: 8a61b63b3d564e597e7a62dd913c97bc64b183b9
This commit is contained in:
parent
4ef383d5db
commit
59ed0c5fd7
1 changed files with 2 additions and 0 deletions
|
|
@ -364,6 +364,8 @@ include(cmake/public/utils.cmake)
|
|||
|
||||
# ---[ Version numbers for generated libraries
|
||||
file(READ version.txt TORCH_DEFAULT_VERSION)
|
||||
# Strip trailing newline
|
||||
string(REGEX REPLACE "\n$" "" TORCH_DEFAULT_VERSION "${TORCH_DEFAULT_VERSION}")
|
||||
if("${TORCH_DEFAULT_VERSION} " STREQUAL " ")
|
||||
message(WARNING "Could not get version from base 'version.txt'")
|
||||
# If we can't get the version from the version file we should probably
|
||||
|
|
|
|||
Loading…
Reference in a new issue