cide icon indicating copy to clipboard operation
cide copied to clipboard

Stuck at Configuring the project ...

Open ruanjiasing opened this issue 2 years ago • 1 comments

It seems CMake needs to be already installed, right? I think I will create a project to test code completion first before actually messing with building. Why do you need CMake to configure the project? Or is it not about CMake but something else?

ruanjiasing avatar Apr 27 '22 11:04 ruanjiasing

Yes, CMake is needed for using CIDE, and the project you would like to work on must be first configured with CMake for code completion to work. The reason for that is that this configure process determines the compiler settings (e.g., include directories, and other compiler flags such as defines passed via the command line) that would be used for compiling the project. To provide correct code completion, it is necessary to know these compiler flags. For example, consider this code:

#include "test.h"

#ifdef SOME_DEFINE
const int a = 42;
#endif
const int b = a;

Here, the IDE must know in which include directories to look for "test.h". It should also know whether there is any compiler flag that defines "SOME_DEFINE", because it will influence whether the variable "a" gets defined or not. (In this example it might appear simple, but this mechanism is most likely needed to correctly parse system-level headers, which are in turn important to be able to provide code completion).

The reason that CIDE specifically requires CMake, instead of other build systems, is simply that CMake is one of the most used build systems for C++ code, and I personally use that exclusively. In principle it would be nice if CIDE also supported other build systems.

By the way, in case you were planning to use the precompiled CIDE binaries, I would recommend to try compiling the latest version from source instead, because the binaries are unfortunately highly outdated. The latest source is the version that I personally use on a daily basis, so it should be rather well-tested (at least for my specific usage pattern). I should really make a new binary release at some point.

puzzlepaint avatar Apr 27 '22 17:04 puzzlepaint

By the way, in case you were planning to use the precompiled CIDE binaries, I would recommend to try compiling the latest version from source instead, because the binaries are unfortunately highly outdated. The latest source is the version that I personally use on a daily basis, so it should be rather well-tested (at least for my specific usage pattern). I should really make a new binary release at some point.

Why don't you just make a new release?

ruanjiasing avatar Aug 10 '22 14:08 ruanjiasing

Why don't you just make a new release?

Because I maintain this open source code in my spare time, and making a release can be some effort because it should ideally be well-tested on all platforms before being published.

puzzlepaint avatar Aug 10 '22 14:08 puzzlepaint

Why don't you just make a new release?

Because I maintain this open source code in my spare time, and making a release can be some effort because it should ideally be well-tested on all platforms before being published.

You could make it a release candidate or pre-release. People did it all the time on github :smile:

ruanjiasing avatar Aug 10 '22 20:08 ruanjiasing

Just to clarify why I afraid building from source. This needs to install the full MSYS2 shell with mingw-w64-x86_64-toolchain, mingw-w64-x86_64-qt5 and many other dependencies. Not to mention we need to install git, cmake, ninja,... All of this takes many GBs on the hard drive and you need bandwidth to download the packages too.

ruanjiasing avatar Aug 10 '22 20:08 ruanjiasing

Well, I think I understand why cmake is needed now. This IDE seems to use clangd language server from clang (or libclang directly?) and clangd needs a compile_commands.json file to provide code completion. This file can be generated by cmake. So why don't make cmake a hard dependency? You will need it to serve as the build system and also need it to generate compile_commands.json.

https://clangd.llvm.org/installation.html

ruanjiasing avatar Aug 20 '22 15:08 ruanjiasing