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

Adds Linux CMake presets for coreclr #110029

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MattBolitho
Copy link

I noticed when opening this project in CLion on Ubuntu that presets are supported for Windows and macOS but not Linux. As macOS support was added recently in #109061, I thought I'd raise this small PR to include Linux x64 as well.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 20, 2024
@MattBolitho
Copy link
Author

@dotnet-policy-service agree

Copy link
Contributor

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

@am11 am11 requested a review from huoyaoyuan November 20, 2024 23:20
@MattBolitho
Copy link
Author

Tagging @huoyaoyuan as per the original contributions to this file

Copy link
Member

@huoyaoyuan huoyaoyuan left a comment

Choose a reason for hiding this comment

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

I have local preset for WSL, which needs more remoting settings. This PR is mostly LGTM and WSL preset can base on it.

"inherits": "base",
"cacheVariables": {
"CLR_CMAKE_TARGET_OS": "linux"
},
Copy link
Member

Choose a reason for hiding this comment

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

                "CMAKE_C_COMPILER": "clang",
                "CMAKE_CXX_COMPILER": "clang++"

Is it using gcc for default? If so, let's default to clang since it's used for most cases.

Copy link
Author

Choose a reason for hiding this comment

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

It is unspecified by default, so it would use whatever is discovered by CMake via environment variables, kit etc.. I initially set it that way because it is possible to build with both gcc and clang but if we want to be explicit to use clang then that's fine too

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, for future usage in the repo, the choice of compiler may be passed with cmake command line. A user can always create a user preset with additional specification. I'm then OK to leave it unspecified.

@@ -233,6 +248,33 @@
"Checked",
"ARM64"
]
},
{
"name": "linux.x64.Debug",
Copy link
Member

Choose a reason for hiding this comment

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

Let's add linux-arm64 too since it's in official support matrix.

@EgorBo
Copy link
Member

EgorBo commented Nov 21, 2024

@MattBolitho I am just curious - what are the steps to be able to debug code in CLion for coreclr repo with sources?

@huoyaoyuan
Copy link
Member

The step should be similar to Visual Studio, see #109097

@EgorBo
Copy link
Member

EgorBo commented Nov 21, 2024

The step should be similar to Visual Studio, see #109097

I am not asking about debugging with source stepping. I am interested in proper intellisense. From my understanding the workflow is a bit more complex

Copy link
Member

@huoyaoyuan huoyaoyuan left a comment

Choose a reason for hiding this comment

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

LGTM, requires an official member to check this in.

@MattBolitho
Copy link
Author

LGTM, requires an official member to check this in.

Thank you for your feedback! I will tag @jkoritzinsky as they merged the previous PR I referenced.

what are the steps to be able to debug code in CLion for coreclr repo with sources?

@EgorBo - I didn't do any deep debugging for the sake of raising this PR yet. My plan is to use CMAKE_EXPORT_COMPILE_COMMANDS with clangd. It works really nicely in VS Code and as clangd is bundled with CLion, it should be possible to replicate that setup. I can try to update later, feel free to suggest the best forum for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants