It seems that on Alpine Linux (Edge), the LLVM_LIBRARY_DIRS cmake
variable doesn't look in /usr/lib, which is where the relevant files are
on Alpine.
Only do this for !WIN32 systems.
This makes the install() function install the file with respect to
`CMAKE_INSTALL_PREFIX` which may not always be `/usr/local/` especially
when some people install the compiler locally in their `$HOME` folder.
https://cmake.org/cmake/help/latest/command/install.html
* CMake option C3_ENABLE_CLANGD_LSP
The CMake option enables the generation of compile_commands.json in
the build directory and the creation of a symlink in the root
directory targeting the new file,
this will allow the Clangd Language Server Protocol (LSP) to
function properly.
* Added .editorconfig
EditorConfig helps maintain consistent coding styles:
https://editorconfig.org/
Properly persist git hash on each build
Rebuild `git_hash.h` only when `.git` folder changes
`add_custom_target()` always considers its target out-of-date which
leads to rebuilding of `git_hash.h` on every build (which is
ironically what we wanted) and consequently rebuilding of
build_options.c and relinking of c3c even when no changes are made,
which is mildly annoying.
We are replacing `add_custom_target()` with `add_custom_command()`
which depends on `.git`, so `git_hash.h` is only rebuilt if any git
commands are performed. Which is less annoying.
In case of no `.git` we simply do not depend on it which leads to
`git_hash.h` being rebuilt only once.
Add parsing for the project command and view subcommand. Add basic implementation of c3c project view. Move get_valid_integer into common build.
Co-authored-by: Christoffer Lerno <christoffer.lerno@gmail.com>
* Fix bug where analysing subexpr relied on them not being analysed. Fix issue where converting a const initializer bool to integer failed. Fix of issue where the case check assumed other cases were const values.
* Fix bug where analysing subexpr relied on them not being analysed. Fix issue where converting a const initializer bool to integer failed. Fix of issue where the case check assumed other cases were const values. Remove PTHREAD for windows.
* Fix bug where analysing subexpr relied on them not being analysed. Fix issue where converting a const initializer bool to integer failed. Fix of issue where the case check assumed other cases were const values. Remove PTHREAD for windows.