Force-linkable amalgamated library for mulle-core initialization libraries
| Release Version | Release Notes | AI Documentation |
|---|---|---|
| RELEASENOTES | DeepWiki for mulle-core-all-load |
There are various methods how to get mulle-core-all-load into your project.
One common denominator is that you will
#include <mulle-core-all-load/mulle-core-all-load.h> in your sources and link
with -lmulle-core-all-load.
Use mulle-sde to add mulle-core-all-load to your project:
mulle-sde add github:mulle-core/mulle-core-all-loadThis library does not include mulle-atinit and mulle-atexit and mulle-testallocator. If you add these libraries, it is important that mulle-core is added before them.
To only add the sources of mulle-core-all-load with dependency sources use clib:
clib install --out src/mulle-core mulle-core/mulle-core-all-loadAdd -isystem src/mulle-core to your CFLAGS and compile all the
sources that were downloaded with your project. (In cmake add
include_directories( BEFORE SYSTEM src/mulle-core) to your CMakeLists.txt
file).
mulle-core is not bundled with mulle-core-all-load. Add both with FetchContent:
include( FetchContent)
set( MULLE__CORE_TAG "master" CACHE STRING "branch or tag to fetch mulle-core from")
FetchContent_Declare( MULLE__CORE
GIT_REPOSITORY https://github.com/mulle-core/mulle-core.git
GIT_TAG "${MULLE__CORE_TAG}")
FetchContent_MakeAvailable( MULLE__CORE)
set( MULLE__CORE__ALL__LOAD_TAG "master" CACHE STRING "branch or tag to fetch mulle-core-all-load from")
FetchContent_Declare( MULLE__CORE__ALL__LOAD
GIT_REPOSITORY https://github.com/mulle-core/mulle-core-all-load.git
GIT_TAG "${MULLE__CORE__ALL__LOAD_TAG}")
FetchContent_MakeAvailable( MULLE__CORE__ALL__LOAD)
target_link_libraries( ${PROJECT_NAME} PRIVATE mulle-core-all-load)FetchContent_MakeAvailable( MULLE__CORE) must come before
FetchContent_MakeAvailable( MULLE__CORE__ALL__LOAD), because mulle-core-all-load depends on
the mulle-core target and its headers.
mulle-core-all-load is a force-linkable initialization library: it registers
atinit/atexit callbacks that must end up in your binary even if no symbol of
the library is referenced directly. The target created by
FetchContent_MakeAvailable carries the necessary INTERFACE force-link options,
so the target_link_libraries( ${PROJECT_NAME} PRIVATE mulle-core-all-load) above
is sufficient. When linking mulle-core-all-load as an installed static library
instead, force-link it explicitly:
# Linux (GCC/Clang)
-Wl,--whole-archive -lmulle-core-all-load -Wl,--no-whole-archive
# macOS
-force_load libmulle-core-all-load.a
# Windows (MSVC)
/WHOLEARCHIVE:mulle-core-all-load.libUse mulle-sde to build and install mulle-core-all-load and all dependencies:
mulle-sde install --prefix /usr/local \
https://github.com/mulle-core/mulle-core-all-load/archive/latest.tar.gzInstall the requirements:
| Requirements | Description |
|---|---|
| libbacktrace | A C library that may be linked into a C/C++ program to produce symbolic backtraces |
| mulle-c11 | π Cross-platform C compiler glue (and some cpp conveniences) |
| mulle-allocator | π Flexible C memory allocation scheme |
| mulle-thread | π Cross-platform thread/mutex/tss/atomic operations in C |
| mulle-dlfcn | βΏοΈ Shared library helper |
Download the latest tar or zip archive and unpack it.
Install mulle-core-all-load into /usr/local with cmake:
PREFIX_DIR="/usr/local"
cmake -B build \
-DMULLE_SDK_PATH="${PREFIX_DIR}" \
-DCMAKE_INSTALL_PREFIX="${PREFIX_DIR}" \
-DCMAKE_PREFIX_PATH="${PREFIX_DIR}" \
-DCMAKE_BUILD_TYPE=Release &&
cmake --build build --config Release &&
cmake --install build --config ReleaseNat! for Mulle kybernetiK