Changed the (primary) build system into CMake instead of Makefile.
Configured CMake to generate a Ninja build. I also updated the documentation a tiny bit, but it will need more updates soon.
There are some new source code files alongside a .h.in header file.
Lastly, .vscode and build directories are gone.
Why:
CMake instead of Makefile
It's mainly due to CMake being cross-platform. Technically a Makefile can be cross-platform, but were I able to write one like so, I would be a Makefile wizard, which, I am not.
It's partly for Ninja. Ninja is much better at tracking dependencies than Makefiles. I did write a simple function to check command-line dependencies in the old Makefile, but it only works assuming you have GNU Core Utils on your system, and that you're running sh/bash/zsh/fish.
A minor detail, but Ninja is said to be faster :smiley:.
Lastly, I am learning CMake alongside all of this :neutral_face:.
Delete the default .vscode
Everytime someone uses VSCode, the IDE is probably going to try and tweak the .vscode file.
So, it's better to let VSCode users generate the .vscode file for their own machines.
Delete the default build directory
Now, to compile code, create a build directory, go there and run CMake.
On Unix systems or Unix systems "emulators" (eg, git bash or MSYS2 on Windows, or even Command Prompt/PowerShell if you have included Mingw-w64 in Path), it should go as:
mkdir build && cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
cmake --build .
# add symlink for clang-tidy to work properly. DO NOT work on Windows Command Prompt or Powershell
ln -s compile_commands.json build/compile_commands.json
New source files
For now, these are for the CMake compilation to run successfully. They currently are empty.
I intend to write a hash table and a Trie for syntax checking.
The header(s) with extension .h.in are processed into .h headers by CMake. For now, I let one of it update the version values.
Updated docs
WORK IN PROGRESS.
I updated the dev environment documentations to reflect on all the changes made.
TODO :eyes:
Dockerfiles and dev containers are still outdated. Needs revising.
What: This is a massive PR, including:
Why:
It's mainly due to CMake being cross-platform. Technically a Makefile can be cross-platform, but were I able to write one like so, I would be a Makefile wizard, which, I am not.
It's partly for Ninja. Ninja is much better at tracking dependencies than Makefiles. I did write a simple function to check command-line dependencies in the old Makefile, but it only works assuming you have GNU Core Utils on your system, and that you're running sh/bash/zsh/fish.
A minor detail, but Ninja is said to be faster :smiley:.
Lastly, I am learning CMake alongside all of this :neutral_face:.
Delete the default .vscode
Delete the default build directory
New source files
.h.in
are processed into.h
headers by CMake. For now, I let one of it update the version values.Updated docs
TODO :eyes: