mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.65k stars 1.64k forks source link

Docs: Meson & CLion #6400

Closed amitdo closed 4 years ago

amitdo commented 4 years ago

Some links I found that can help anyone working with Meson & CLion:

Compilation Database

Custom Build Targets and Applications

CLion 2018.2 EAP: open project from Compilation Database

CLion 2018.2.3: better compilation database integration

Feel free to add this information to the docs. Note that I don't have any experience working with CLion.

dreamer-coding commented 4 years ago

I actually find this useful for developing a custom backend for CLine in Meson-UI, thanks.

coelle commented 4 years ago

This tip works great.

Drawback: The compile_commands.json resides in the build directory and opening this files as project, creates all CLion specific files (.idea/) in the same directory. So if you cleanup your build directory, the CLion files are deleted too! Any suggestions how to handle this? Generate the compile_commands.json in an other directory? How?

amitdo commented 4 years ago

I don't know, but you can ask JetBrains/their community:

https://www.jetbrains.com/help/clion/getting-help.html

coelle commented 4 years ago

This tip works great.

Drawback: The compile_commands.json resides in the build directory and opening this files as project, creates all CLion specific files (.idea/) in the same directory. So if you cleanup your build directory, the CLion files are deleted too! Any suggestions how to handle this? Generate the compile_commands.json in an other directory? How?

There is a ticket to handle this: https://youtrack.jetbrains.com/issue/CPP-13699

Workaround: Before opening the compile_commands.json as project, create a symlink in the project root directory, e. g. ln -s build/compile_commands.json . When creating the External Tool for the Custom Build Target, enter $ProjectFileDir$ as Working Directory (The symbolic link is resolved by CLion therefore $ProjectFileDir$/build points to the wrong location).

nh2 commented 4 years ago

It's useful to know that meson already generates compile_commands.json into the build directory, but this is currently not obvious from the docs: https://github.com/mesonbuild/meson/issues/3545#issuecomment-588367563

This means you do not have to generate it manually as shown on https://web.archive.org/save/https://wanzenbug.xyz/clion-meson-compiledb/

nh2 commented 4 years ago

ln -s build/compile_commands.json .

Note for others: If you switch to that approach, best clean out related .idea/ folders first, otherwise opening that symlink will continue to open the your build directory as the project root.

amitdo commented 3 years ago

More useful links:

https://blog.jetbrains.com/clion/2021/01/working-with-meson-in-clion-using-compilation-db/

https://www.jetbrains.com/help/clion/managing-makefile-projects.html

dreamer-coding commented 3 years ago

These would be fantastic in the Meson Reddit, MeWe and Facebook groups.

On Sun, Feb 21, 2021 at 9:31 AM Amit D. notifications@github.com wrote:

More useful links:

https://blog.jetbrains.com/clion/2021/01/working-with-meson-in-clion-using-compilation-db/

https://www.jetbrains.com/help/clion/managing-makefile-projects.html

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mesonbuild/meson/issues/6400#issuecomment-782893723, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANGEVUHH446CLVPM2YYAUCTTAE7Q3ANCNFSM4KCADPKA .

amitdo commented 3 years ago

Feel free to spread these links :-)

amitdo commented 1 year ago

* **** commented 2 Dec

... indeed, we have plans to support Meson in the near future.

https://youtrack.jetbrains.com/issue/CPP-4926/Support-Meson-build-system

amitdo commented 1 year ago

https://youtrack.jetbrains.com/issue/CPP-4926

Sam Kolton commented 16 Jun 2023 11:28

Hello, everyone! Here's a brief update on our progress: we are actively working on the Meson support. However, it is not yet ready to be shipped with the 2023.2 release. While we cannot provide a definite ETA, we are tentatively aiming to have it ready for the 2023.3 release. We acknowledge the importance of Meson and remain committed to its ongoing development.

amitdo commented 11 months ago

https://blog.jetbrains.com/clion/2023/12/clion-classic-2023-3-released-ai/#cpp_project_models

https://www.jetbrains.com/help/clion/meson.html