CLion 2021.1 EAP: Clazy Analyzer, Better Makefile Projects Support, Sharing CMake Settings in VCS
The CLion 2021.1 EAP program is underway and we’ve already introduced Global Data Flow Analysis, Google Sanitizers, Valgrind Memcheck, Code Coverage in remote mode, CMake 3.19, and more.
Today we’re releasing the CLion 2021.1 EAP2 build, with even more new features for you to preview.
Build 211.5787.12 is available from our website, via the Toolbox App, or as a snap package (if you are using Ubuntu). Note that if you are on macOS, there is a separate build for Apple Silicon (M1 chip).
Main highlights:
-
Qt projects:
- Clazy: CLion now has a Qt-oriented static code analyzer.
- QtCreator keymap.
-
Makefile projects:
- Makefile plugin is now bundled.
- Use compilers from toolchain during Makefile project resolution.
-
CMake projects:
- You can now share CMake options in VCS.
- CMake Profile Wizard is added.
- Go to declaration performance improvements.
- A new inspection: catching unmatched header guards.
Qt projects
In CLion 2020.3 we added more sophisticated support for Qt projects that included code completion for signals and slots, Qt-style auto-import, and some Qt projects and Qt UI class templates. We’re not stopping there!
In this EAP we’ve integrated Clazy, a Qt-oriented static code analyzer, into CLion. We did it in the same way we implemented the Clang-Tidy integration, meaning checks appear in the editor similarly to how they are displayed in CLion’s own static analyzer:
Clazy is integrated into CLion’s own language engine based on Clangd, and the version currently used in CLion is 1.8.
In Settings/Preferences | Editor | Inspections | C/C++ | General | Clazy settings you can configure CLion’s severity level and the level of Clazy checks:
If you’re coming from QtCreator, you’ll be happy to know that CLion now bundles the QtCreator keymap. You can switch to it in Settings or via a Quick Switch Scheme action:
Makefile projects
The Makefile Language plugin (previously 3rd-party) is now maintained by the CLion team and is bundled into CLion and GoLand in 2021.1 EAP:
You no longer need to install the plugin manually, so you now get make
syntax highlighting, quick documentation, Find Usages for targets, and some navigation and code completion actions for Makefile right out of the box!
When loading a Makefile project, CLion now not only uses the make
executable from the Makefile Toolchain, but also takes compilers from it (if configured explicitly in the corresponding Toolchain). This renders our Makefile project support more consistent and accurate.
CMake Profiles
CMake Profiles, which are used when building projects via CMake, can be configured in Settings/Preferences | Build, Execution, Deployment | CMake in CLion. These settings are now stored in cmake.xml in the .idea directory and can be shared in the VCS along with the project. Simply tick the Share option in the settings. This new ability makes it much easier for the team to share a single CMake setup between all members!
Users can have both shared and local profiles (local profiles always go first in the list of profiles in settings) and switch between them in the editor.
Known limitations:
- CMake Profiles with the same name are not allowed. If a shared and a local profile both have the same name, the local profile takes precedence and the shared one won’t appear in the settings.
- Only CMake Profile settings can be shared. The “Reload CMake project on editing CMakeLists.txt” setting is common for all profiles and is stored in workspace.xml.
CLion now comes with a CMake Profile Wizard which helps users configure Toolchains and CMake Profiles for the first time. Depending on whether the project has previously opened, the process may include the following steps:
- The Toolchains step is shown only if CLion is being launched for the first time and settings were not imported.
- The CMake profiles step is shown if the project is opened for the first time (i.e. if the .idea directory is missing) or if workspace.xml or cmake.xml is missing in .idea or all the profiles are disabled.
It’s worth mentioning that closing the Toolchain/CMake wizard automatically saves all the introduced changes.
Improved navigation performance for the Eigen library
The most widely used navigation action, Go to Declaration, now works faster in the Eigen library (CPP-15082).
Catching the unmatched header guard
We’ve added a new static code analysis check to catch situations when the comment at the #endif
preprocessor directive doesn’t match the macro name from the #ifndef
:
The full release notes are available here.
Your CLion team
JetBrains
The Drive to Develop