diff options
author | Trumeet <yuuta@yuuta.moe> | 2022-07-27 15:03:00 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2022-07-27 15:03:00 -0700 |
commit | d935aa8516f2eab5cbde467b9c92400dcf636bcb (patch) | |
tree | 49c9a70ea57b4cb3fd74ad9bf6e1ca913da456ae /client/libacron/README.md | |
parent | 3a450ee1759b3df38d698daabdfafd0447d8223a (diff) | |
download | acron-d935aa8516f2eab5cbde467b9c92400dcf636bcb.tar acron-d935aa8516f2eab5cbde467b9c92400dcf636bcb.tar.gz acron-d935aa8516f2eab5cbde467b9c92400dcf636bcb.tar.bz2 acron-d935aa8516f2eab5cbde467b9c92400dcf636bcb.zip |
build(libacron): switch to Meson
Meson is better on resolving dependencies on various platforms.
Diffstat (limited to 'client/libacron/README.md')
-rw-r--r-- | client/libacron/README.md | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/client/libacron/README.md b/client/libacron/README.md index 4514e21..5fba5c6 100644 --- a/client/libacron/README.md +++ b/client/libacron/README.md @@ -9,7 +9,7 @@ Requirements: * `json-c` installed and using PkgConfig * Git -* CMake +* Meson * A C11 or higher C compiler * Connectivity to this git repository and `github.com` @@ -20,11 +20,10 @@ git clone https://git.yuuta.moe/Minecraft/acron.git cd acron git submodule update --init cd client/libacron/ -mkdir build +meson build -Dbuildtype=release cd build -cmake -DCMAKE_BUILD_TYPE=Release .. -cmake --build . -DESTDIR=$(pwd)/install cmake --install . +ninja +DESTDIR=$(pwd)/install meson install ``` The shared library will be at `libac.so` (`ac.dll` on Windows). The static library will be at `libac-static.a` (`ac-static.lib` on Windows). @@ -33,18 +32,6 @@ The distributable headers are at `install/usr/local/include/libac/`. To make debug builds, use the Debug build type. Debug builds will have ASAN enabled. -To build on Windows: - -```batch -git clone https://git.yuuta.moe/Minecraft/acron.git -CD acron -git submodule update --init -CD client/libacron/ -setup.bat -mkdir build -cmake -DCMAKE_BUILD_TYPE=Release .. -cmake --build . -``` ## Usage @@ -264,6 +251,19 @@ connection-related functions from any threads. Example `apps/helloworld/main.c` has a naive cross-platform example of how to guard the connection using a mutex. +## Development + +To make development builds, use the following `meson(1)` command: + +```shell +CC=cc meson build -Dsanitize=address +``` + +1. If you have `ccache` installed, you need to manually specify a C compiler to NOT use ccache, as CLion does not recognize ccache. +2. Use `-Dsanitize` to enable ASAN. + +To open in CLion, refer to [https://blog.jetbrains.com/clion/2021/01/working-with-meson-in-clion-using-compilation-db](https://blog.jetbrains.com/clion/2021/01/working-with-meson-in-clion-using-compilation-db/). Be warned that CLion support is still primitive. + ## Roadmap * Make unit tests |