Skip to content

Show cmake debug information.#2316

Merged
csukuangfj merged 2 commits into
k2-fsa:masterfrom
csukuangfj:cmake-git-info
Jun 25, 2025
Merged

Show cmake debug information.#2316
csukuangfj merged 2 commits into
k2-fsa:masterfrom
csukuangfj:cmake-git-info

Conversation

@csukuangfj

Copy link
Copy Markdown
Collaborator

No description provided.

@csukuangfj csukuangfj requested a review from Copilot June 25, 2025 09:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a CMake module that prints build and environment information and integrates it into the main build.

  • Introduce cmake/show-info.cmake to log CMake variables, Git SHA/date, OS details, and compiler info.
  • Modify CMakeLists.txt to include the new show-info module after setting up the module path.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
cmake/show-info.cmake New script to output debug information during configuration
CMakeLists.txt Include the show-info module after configuring module paths

Comment thread cmake/show-info.cmake Outdated
Comment thread cmake/show-info.cmake

if(UNIX AND NOT APPLE)
execute_process(COMMAND
lsb_release -sd

Copilot AI Jun 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invoking lsb_release without checking availability may fail on systems where it's not installed. Use find_program to locate lsb_release and guard the execute_process call if not found.

Copilot uses AI. Check for mistakes.
Comment thread cmake/show-info.cmake
# Now SHERPA_ONNX_OS_TWO_LINES contains something like
# Caption Version
# Microsoft Windows 10 Pro 10.0.18362
string(REPLACE "\n" ";" SHERPA_ONNX_OS_LIST ${SHERPA_ONNX_OS_TWO_LINES})

Copilot AI Jun 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WMIC output may include carriage returns (\r) on Windows. Consider stripping \r before splitting on \n to avoid residual \r characters in list elements.

Suggested change
string(REPLACE "\n" ";" SHERPA_ONNX_OS_LIST ${SHERPA_ONNX_OS_TWO_LINES})
string(REPLACE "\r" "" SHERPA_ONNX_OS_TWO_LINES_CLEANED ${SHERPA_ONNX_OS_TWO_LINES})
string(REPLACE "\n" ";" SHERPA_ONNX_OS_LIST ${SHERPA_ONNX_OS_TWO_LINES_CLEANED})

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@csukuangfj csukuangfj merged commit 074236a into k2-fsa:master Jun 25, 2025
111 of 167 checks passed
@csukuangfj csukuangfj deleted the cmake-git-info branch June 25, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants