Show cmake debug information.#2316
Merged
Merged
Conversation
There was a problem hiding this comment.
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.cmaketo log CMake variables, Git SHA/date, OS details, and compiler info. - Modify
CMakeLists.txtto include the newshow-infomodule 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 |
|
|
||
| if(UNIX AND NOT APPLE) | ||
| execute_process(COMMAND | ||
| lsb_release -sd |
There was a problem hiding this comment.
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.
| # 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}) |
There was a problem hiding this comment.
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}) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.