From d935aa8516f2eab5cbde467b9c92400dcf636bcb Mon Sep 17 00:00:00 2001 From: Trumeet Date: Wed, 27 Jul 2022 15:03:00 -0700 Subject: build(libacron): switch to Meson Meson is better on resolving dependencies on various platforms. --- client/libacron/README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'client/libacron/README.md') 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 -- cgit v1.2.3