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
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/coreclr/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@
}
}
},
{
"name": "linux-base",
"hidden": true,
"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.

"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
]
}
}
},
{
"name": "Debug",
"hidden": true,
Expand Down Expand Up @@ -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.

"displayName": "linux.x64.Debug",
"inherits": [
"linux-base",
"Debug",
"x64"
]
},
{
"name": "linux.x64.Release",
"displayName": "linux.x64.Release",
"inherits": [
"linux-base",
"Release",
"x64"
]
},
{
"name": "linux.x64.Checked",
"displayName": "linux.x64.Checked",
"inherits": [
"linux-base",
"Checked",
"x64"
]
}
]
}