Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Commit

Permalink
fixup: macos: CMakeLists: truncate Homebrew version if there is multi…
Browse files Browse the repository at this point in the history
…ple lines

Signed-off-by: Ookiineko <[email protected]>
  • Loading branch information
Ookiineko committed Nov 21, 2023
1 parent d9b6b6b commit 34ef71d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.compat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ elseif (APPLE)
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (HOMEBREW_VERSION MATCHES "^Homebrew[ \\t]+")
string(REGEX REPLACE "^Homebrew[ \\t]+" "" HOMEBREW_VERSION ${HOMEBREW_VERSION})
if (HOMEBREW_VERSION MATCHES "^Homebrew[ \t]+")
string(REGEX MATCH "^Homebrew[ \t]+[^\n]+" HOMEBREW_VERSION ${HOMEBREW_VERSION})
string(REGEX REPLACE "^Homebrew[ \t]+" "" HOMEBREW_VERSION ${HOMEBREW_VERSION})
else()
set(HOMEBREW_VERSION "unknown")
endif()
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.rust.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ foreach(RUSTC_OUTPUT_LINE ${RUSTC_OUTPUT})
if (RUSTC_OUTPUT_LINE STREQUAL "")
continue()
else()
if (RUSTC_OUTPUT_LINE MATCHES "^rustc[ \\t]+")
if (RUSTC_OUTPUT_LINE MATCHES "^rustc[ \t]+")
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" RUSTC_VERSION ${RUSTC_OUTPUT_LINE})
elseif (RUSTC_OUTPUT_LINE MATCHES "^host:[ \\t]+")
string(REGEX REPLACE "^host:[ \\t]+" "" RUSTC_TARGET ${RUSTC_OUTPUT_LINE})
elseif (RUSTC_OUTPUT_LINE MATCHES "^host:[ \t]+")
string(REGEX REPLACE "^host:[ \t]+" "" RUSTC_TARGET ${RUSTC_OUTPUT_LINE})
endif()
endif()
endforeach()
Expand All @@ -34,8 +34,8 @@ execute_process(
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (CARGO_VERSION MATCHES "^cargo[ \\t]+")
string(REGEX REPLACE "^cargo[ \\t]+" "" CARGO_VERSION ${CARGO_VERSION})
if (CARGO_VERSION MATCHES "^cargo[ \t]+")
string(REGEX REPLACE "^cargo[ \t]+" "" CARGO_VERSION ${CARGO_VERSION})
else()
set(CARGO_VERSION "unknown")
endif()
Expand Down

0 comments on commit 34ef71d

Please sign in to comment.