[feature] Support visual studio backend for meson
See original GitHub issueReading the docs https://docs.conan.io/en/latest/reference/build_helpers/meson.html
It would seem conan assumes that meson will always use ninja as the build backend. However meson allows you to build using msvc through the flan --backend
.
This means that the following meson command:
meson setup build_vs --backend=vs2019 -Dpkg_config_path=build_vs
Cannot be assembled from the conan.py script.
If you try something like this:
args = [f'-Dpkg_config_path={os.path.abspath("../" + str(self.folders.generators))}']
if self.settings.compiler == "gcc":
self.output.error("gcc")
args += ["-Db_sanitize=undefined", "-Dcpp_std=c++20"]
if self.settings.compiler == "Visual Studio":
self.output.error("VS")
args += ["--backend=vs2019", "-Dcpp_std=c++20"]
meson = Meson(self)
meson.configure(build_folder='.', args=args)
meson.build(args=['-j2'])
You will get this error:
ERROR: conanfile.py: Error in build() method, line 123
meson.build(args=['-j2'])
ConanException: Error 1 while executing ninja -C "C:\Users\Makogan\Documents\neverengine\build_visual_studio_debug\." -j2
- [ x ] I’ve read the CONTRIBUTING guide.
Issue Analytics
- State:
- Created 2 years ago
- Comments:26 (26 by maintainers)
Top Results From Across the Web
Using with Visual Studio - The Meson Build system
If you wish to generate Visual Studio project files, pass --backend vs . At the time of writing the Ninja backend is more...
Read more >Meson - PostgreSQL wiki
... meson only supports building out of tree. set up build tree for visual studio, perl src/tools/msvc/mkvcbuild.pl, meson setup --backend ...
Read more >Compilation and Installation Using Meson - Mesa 3D
Meson only supports out-of-tree builds, and must be passed a directory to put ... passing --backend=vs to Meson will generate a Visual Studio...
Read more >Meson (software) - Wikipedia
Meson is a software tool for automating the building (compiling) of software. The overall goal for Meson is to promote programmer productivity.
Read more >Compilation and Installation using Meson
The meson program is used to configure the source directory and generates either a ninja build file or Visual Studio® build files.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I made a pull request, the change is so small this should not break compatibility, it handles a strict superset of cases:
https://github.com/conan-io/conan/pull/10447
@franramirez688
I have wanted to do a
conan new --template=meson_lib
for a while, to help with this. Would it make sense to try to contribute this asap?