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

ADD: Add CMake build option for tests and example C++ program #2036

Merged
merged 14 commits into from
Sep 9, 2024

Conversation

T-K-233
Copy link
Member

@T-K-233 T-K-233 commented Sep 7, 2024

Add support to build tests with CMake:

To build the programs, do

# cd ./tests/
cmake . -S ./ -B ./build/ -D CMAKE_BUILD_TYPE=Debug
cmake --build ./build/ --target all

To clean the previous build, do

# cd ./tests/
cmake --build ./build/ --target clean

Related PRs / Issues:

Type of change:

  • Bug fix
  • New feature
  • Other enhancement

Impact:

  • RTL change
  • Software change (RISC-V software)
  • Build system change
  • Other

Contributor Checklist:

  • Did you set main as the base branch?
  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you state the type-of-change/impact?
  • Did you delete any extraneous prints/debugging code?
  • Did you mark the PR with a changelog: label?
  • (If applicable) Did you update the conda .conda-lock.yml file if you updated the conda requirements file?
  • (If applicable) Did you add documentation for the feature?
  • (If applicable) Did you add a test demonstrating the PR?
  • (If applicable) Did you mark the PR as Please Backport?

CI Help:
Add the following labels to modify the CI for a set of features.
Generally, a label added only affect subsequent changes to the PR (i.e. new commits, force pushing, closing/reopening).
See ci:* for full list of labels:

  • ci:fpga-deploy - Run FPGA-based E2E testing
  • ci:local-fpga-buildbitstream-deploy - Build local FPGA bitstreams for platforms that are released
  • ci:disable - Disable CI

@T-K-233 T-K-233 self-assigned this Sep 7, 2024
@jerryz123
Copy link
Contributor

All the C programs build with this too? That's neat.

Can you replace the existing makefile such that 'make' just invokes cmake?

@T-K-233
Copy link
Member Author

T-K-233 commented Sep 8, 2024

I don't think using make to invoke cmake is a good idea... It's a bit convoluted.
If we want to use cmake to replace the current make flow, I can write a .sh script to abstract away the cmake commands, so user would just need to call something like ./build.sh.

@jerryz123
Copy link
Contributor

Replacing it with build.sh is fine to me too. Note that many parts of the CI scripts call make, those would have to be changed to build.sh

@jerryz123 jerryz123 merged commit 09e7ee6 into main Sep 9, 2024
66 checks passed
@jerryz123 jerryz123 deleted the build-system branch September 9, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants