meson | CMake | |
---|---|---|
112 | 32 | |
5,506 | 6,755 | |
1.6% | 1.7% | |
9.8 | 10.0 | |
3 days ago | 2 days ago | |
Python | C | |
Apache License 2.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
meson
-
cargo-c common questions
With cargo-c I try to use the best practices to support as many platform as possible, trying to stay in sync with what meson does. Sadly what is conceptually trivial, installing a package, has lots of details that are platform-specific.
- Ask HN: How to handle user file uploads?
-
Which Build Tool for a Bootstrappable Project?
[1]: https://github.com/mesonbuild/meson/issues/8153
-
Building Waybar fails
The Meson build system Version: 1.2.3 Source dir: /home/patrik/workspace/Waybar Build dir: /home/patrik/workspace/Waybar/build Build type: native build Project name: waybar Project version: 0.9.24 C compiler for the host machine: cc (gcc 13.2.0 "cc (Debian 13.2.0-5) 13.2.0") C linker for the host machine: cc ld.bfd 2.41 C++ compiler for the host machine: c++ (gcc 13.2.0 "c++ (Debian 13.2.0-5) 13.2.0") C++ linker for the host machine: c++ ld.bfd 2.41 Host machine cpu family: x86_64 Host machine cpu: x86_64 Compiler for C++ supports link arguments -lc++fs: NO Compiler for C++ supports link arguments -lc++experimental: NO Compiler for C++ supports link arguments -lstdc++fs: YES Program git found: YES (/usr/bin/git) WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300 Has header "filesystem" : YES Checking if "nl_langinfo with _NL_TIME_WEEK_1STDAY, _NL_TIME_FIRST_WEEKDAY" : links: YES Run-time dependency threads found: YES Found pkg-config: /usr/bin/pkg-config (1.8.1) Run-time dependency fmt found: YES 9.1.0 Run-time dependency spdlog found: YES 1.12.0 Run-time dependency wayland-client found: YES 1.22.0 Run-time dependency wayland-cursor found: YES 1.22.0 Run-time dependency wayland-protocols found: YES 1.32 Run-time dependency gtkmm-3.0 found: YES 3.24.8 Run-time dependency dbusmenu-gtk3-0.4 found: YES 16.04.0 Run-time dependency gio-unix-2.0 found: YES 2.78.1 Run-time dependency jsoncpp found: YES 1.9.4 Run-time dependency sigc++-2.0 found: YES 2.12.1 Found CMake: /usr/bin/cmake (3.27.7) Run-time dependency libinotify found: NO (tried pkgconfig and cmake) Run-time dependency epoll-shim found: NO (tried pkgconfig and cmake) Run-time dependency libinput found: YES 1.23.0 Run-time dependency libnl-3.0 found: YES 3.7.0 Run-time dependency libnl-genl-3.0 found: YES 3.7.0 Run-time dependency upower-glib found: YES 1.90.2 Run-time dependency libpipewire-0.3 found: YES 0.3.85 Run-time dependency playerctl found: YES 2.4.1 Run-time dependency libpulse found: YES 16.1 Run-time dependency libudev found: YES 252 Run-time dependency libevdev found: YES 1.13.1 Run-time dependency libmpdclient found: YES 2.20 Run-time dependency xkbregistry found: YES 1.6.0 Run-time dependency jack found: YES 0.126.0 Run-time dependency wireplumber-0.4 found: YES 0.4.15 Library sndio found: YES Checking for function "sioctl_open" with dependency -lsndio: YES Run-time dependency gtk-layer-shell-0 found: YES 0.8.1 Run-time dependency systemd found: YES 252 Computing int of "__cpp_lib_chrono" : 201611 Configuring waybar.service using configuration Run-time dependency cava found: NO (tried pkgconfig and cmake) Looking for a fallback subproject for the dependency cava Executing subproject cava cava| Project name: cava cava| Project version: 0.9.1 cava| C compiler for the host machine: cc (gcc 13.2.0 "cc (Debian 13.2.0-5) 13.2.0") cava| C linker for the host machine: cc ld.bfd 2.41 cava| Has header "iniparser.h" : NO cava| Has header "iniparser4/iniparser.h" : NO Message: cava is not found. Building waybar without cava subprojects/cava-0.9.1/meson.build:65:3: ERROR: Problem encountered: iniparser library is required A full log can be found at /home/patrik/workspace/Waybar/build/meson-logs/meson-log.txt WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
-
How to find a list of all gcc errors/warnings?
As it happens, I recently landed a PR in meson to add a clang-like Weverything mode that includes all of that, so you can get a minimal list of more or less all GCC warnings, organized by version, from the meson source here: https://github.com/mesonbuild/meson/blob/710a753c78077220b13a9f7e999dcdb61339efb1/mesonbuild/compilers/mixins/gnu.py
-
Makefile Tutorial
Came here to post the same. The answer for How to build software? is Meson[1] for C and C++ and also other languages. Works well on Windows and Mac, too.
I’ve written a small Makefile to learn the basic and backgrounds. Make is fine. But the next high-level would have been Autotools, which is an intimidating and weird set of tools. Most new stuff written in C/C++ use now Meson and it feels sane.
[1] https://mesonbuild.com
-
CMake x make?
If you are very fortunate, you'll be able to choose something else. I like meson myself: it looks a bit like python, it's popular, small, simple, well-documented, easy to install and update, and it works well everywhere.
-
C++ Papercuts
I suggest changing the build tool. Meson improved C and C++ a lot:
https://mesonbuild.com/
The dependency declaration and auto-detection is nice. But the hidden extra is WrapDB, built-in package management (if wanted):
https://mesonbuild.com/Wrap-dependency-system-manual.html
-
A Modern C Development Environment
> C's only REAL problem (in my opinion) which is the lack of dependency management. Most everything else can be done with a makefile and a half decent editor.
Care to hear about our lord and saviour Meson?
Both of your quoted problems are mutually incompatible: dependency management isn't the job of the compiler, it's a job for the build or host system. If you want to keep writing makefiles, be prepared to write your own `wget` and `git` invocations to download subprojects.
Meanwhile, Meson solves the dependency management problem in a way that makes both developers and system integrators/distributions happy. It forces you to make a project that doesn't have broken inter-file or header dependency chains and cleans up all the clutter and cruft of a makefile written for any non-trivial project, while making it trivial to integrate other meson projects into your build, let other people integrate your project into theirs, and provides all of the toggles and environment variables distribution developers need to package your library properly. You can really have your cake and eat it too.
https://mesonbuild.com/
-
cgen: another declarative CMake configuration generator
Other people going down this route seem to end up writing cmake replacements instead. I'm thinking of something like meson here except that meson never intended to transpile to cmake.
CMake
-
Installer script for CMake, Ninja, and Meson
I thought I would share my custom installer script for the latest GitHub versions of CMake, Ninja, and Meson.
-
CMake can't find glut
The same thing probably applies if you use the FindGlut.cmake module which is documented here: https://cmake.org/cmake/help/latest/module/FindGLUT.html
-
FFmpeg Build Script that uses API calls to get the latest versions of each package + extra modules
building cmake - version 3.26.3 ==================================== Downloading https://github.com/kitware/cmake/archive/refs/tags/v3.26.3.tar.gz as cmake-3.26.3.tar.gz Download Completed File extracted: cmake-3.26.3.tar.gz $ ./configure --prefix=/root/ffmpeg-build-script/workspace --parallel=40 --enable-ccache -- -DCMAKE_USE_OPENSSL=OFF $ make -j 40
-
I can't run my c++ project having Python.h header using cmake in Windows
find_package(Python3 ...) will look for a file FindPython3.cmake shipped with CMake. I urge you to try to go over its contents to get an idea of what it does underneath.
-
using a library from a github repository in cmake project
The file FindSomePKG.cmake (module approach) is supposed to be written either by you (you write it manually and put in a cmake subdirectory in your git repo) or it's an official package file shipped along with CMake, e.g FindOpenSSL.cmake with documentation here.
- Install CMake on Windows
-
Install MariaDB from Source Code on Ubuntu
sudo apt-get install build-essential libncurses5-dev gnutls-dev bison zlib1g-dev ccache libssl-dev # Get cmake # Downloaded under ~/ wget https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz cd cmake-3.25.2 ~/cmake-3.25.2 $ ./bootstrap ~/cmake-3.25.2 $ make ~/cmake-3.25.2 $ sudo make install
-
Adding “invariant” clauses to C++ via GCC plugin to enable Design-by-Contract
Note that `assert`s are disabled if you define the macro `NDEBUG`, e.g. https://godbolt.org/z/hMWo8KM7q
CMake adds these flags to release builds: https://github.com/Kitware/CMake/blob/e1eacbe2c522a8bf9a82af...
Would be nice to have a non-macro solution for controlling behavior at configure time, but the `NDEBUG` macro is basically already your `DEBUG` constexpr.
-
CLion 2022.3 Released!
It's open-source. It might get merged in!
-
Couchbase Node SDK on Docker
FROM node:16 WORKDIR /cmake COPY cmake-3.25.0-rc4-linux-x86_64.sh ./ # OR # RUN apt update && apt install -y g++ wget bash # RUN wget https://github.com/Kitware/CMake/releases/download/v3.25.0-rc4/cmake-3.25.0-rc4-linux-x86_64.sh RUN ./cmake-3.25.0-rc4-linux-x86_64.sh --skip-license && rm cmake-3.25.0-rc4-linux-x86_64.sh ENV PATH="$PATH:/cmake/bin" WORKDIR /app RUN npm i [email protected] COPY package.json . COPY package-lock.json . RUN npm --verbose i COPY . . RUN npm --verbose run build
What are some alternatives?
ninja - a small build system with a focus on speed
gcc
SCons
Bazel - a fast, scalable, multi-language and extensible build system
awesome-bazel - A curated list of Bazel rules, tooling and resources.
cmake-init - The missing CMake project initializer
bazel-remote - A remote cache for Bazel
BitBake - The official bitbake Git is at https://git.openembedded.org/bitbake/. Do not open issues or file pull requests here.
Boost.Beast - HTTP and WebSocket built on Boost.Asio in C++11
conan - Conan - The open-source C and C++ package manager
fuzzing - Tutorials, examples, discussions, research proposals, and other resources related to fuzzing