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

[feature request] Switch toolchain or corss-file on GUI #151

Open
ZZH-Finalize opened this issue Aug 18, 2023 · 9 comments
Open

[feature request] Switch toolchain or corss-file on GUI #151

ZZH-Finalize opened this issue Aug 18, 2023 · 9 comments

Comments

@ZZH-Finalize
Copy link

ZZH-Finalize commented Aug 18, 2023

I hope there is a select box on vscode GUI to select the toolchain or cross-file to use, and this selected file should be appended as an argument to meson command line, just like the "CMake Tools" does(extension id: ms-vscode.cmake-tools)

@ZZH-Finalize ZZH-Finalize changed the title [feature request] [feature request] Switch toolchain or corss-file on GUI Aug 18, 2023
@tristan957
Copy link
Contributor

The problem with that is, Meson machine files aren't recognizable in the sense that they don't have a special file name or anything.

@ZZH-Finalize
Copy link
Author

"CMake Tools" extension uses a specific Json file to record all the toolchains and "toolchain files". When we select a toolchain, it is actually selecting an object from that Json file, "CMake Tools" will load that object and parse the information. I think this is also applicable to the "vscode-meson".

@tristan957
Copy link
Contributor

In CMake that file is well known. It has a specific name. We don't enforce names for machine files, for better or for worse.

@ZZH-Finalize
Copy link
Author

ZZH-Finalize commented Aug 18, 2023

The file I mentioned does NOT belong to cmake, it is created by the "CMake Tools", in my PC, the path to it is "C:\Users\zzh\AppData\Local\CMakeTools\cmake-tools-kits.json" . It is neither a "CMakeUserPresets.json" nor a "CMakePresets.json", it is just a configuration file specific for the "CMake Tools" extension.

What I mean is, could we create a "meson-crossfile.json" file specific for "vscode-meson" extension, in this file we write something like this

{
    "gcc": "/home/zzh/toolchains/gcc.ini",
    "clang": "/home/zzh/toolchains/clang.ini"
}

The "gcc" and "clang" are custom names for GUI items, the "/home/zzh/toolchains/gcc.ini" is the path to the machine file, the "meson-crossfile.json" is a specific name. There is no need to enforce the name for machine files.

@tristan957
Copy link
Contributor

Could you provide a screenshot/video of the CMake extension doing this? I am having trouble understanding.

@xclaesse
Copy link
Member

xclaesse commented Aug 18, 2023

I like the idea of having a set of cross files and an easy way to click which platform to build for. Meson itself should probably install/provide some of its cross files: https://github.com/mesonbuild/meson/tree/master/cross. The list could then be extended by user entering full path to its custom cross files.

An extra step meson-vscode can take is to append arch/platform to the builddir, e.g. selecting mingw cross file will automatically build into builddir_x86_64_windows.

@tristan957
Copy link
Contributor

tristan957 commented Aug 18, 2023

Meson itself should probably install/provide some of its cross files

I like this idea quite a bit. Doesn't Meson itself also look in some XDG dir for machine files?

@ZZH-Finalize
Copy link
Author

Could you provide a screenshot/video of the CMake extension doing this? I am having trouble understanding.

unknown_2023.08.19-10.49_2.mp4

This is a demo for "CMake Tools".

@ZZH-Finalize
Copy link
Author

I like the idea of having a set of cross files and an easy way to click which platform to build for. Meson itself should probably install/provide some of its cross files: https://github.com/mesonbuild/meson/tree/master/cross. The list could then be extended by user entering full path to its custom cross files.

An extra step meson-vscode can take is to append arch/platform to the builddir, e.g. selecting mingw cross file will automatically build into builddir_x86_64_windows.

@tristan957 I like this solution too. It is not necessary to do everything like "CMake Tools" does.

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

No branches or pull requests

3 participants