Skip to content

Library designed to abstract most of The programming language code

License

Notifications You must be signed in to change notification settings

thelang-io/libd4

Repository files navigation

libd4

A library specifically designed for The programming language.

Building and installing

To build with CMake:

cmake . -B ./build
cmake --build build --config Debug

To install with CMake:

cmake --install build

To build and install with Docker:

docker build -t libd4 .

Usage

You can import specific utility with:

#include <d4/macro.h>

With GCC/Clang:

cc main.c -o program -ld4

With CMake:

cmake_minimum_required(VERSION 3.14)

find_path(LIBD4_INCLUDE_DIR d4/macro.h)
find_library(LIBD4_LIBRARY libd4)

# ...

target_include_directories(target PUBLIC "${LIBD4_INCLUDE_DIR}")
target_link_libraries(target PUBLIC "${LIBD4_LIBRARY}")

With CMake's FetchContent:

cmake_minimum_required(VERSION 3.14)
include(FetchContent)

FetchContent_Declare(libd4 GIT_REPOSITORY https://github.com/thelang-io/libd4.git GIT_TAG v1.0.0)
FetchContent_MakeAvailable(libd4)

# ...

target_include_directories(target PUBLIC "${libd4_SOURCE_DIR}/include")
target_link_libraries(target PUBLIC libd4)

Testing

To test your build with CMake:

Without Checking Memory Leaks

cmake . -B ./build -D LIBD4_BUILD_EXAMPLES=ON -D LIBD4_BUILD_TESTS=ON
cmake --build build --config Debug
ctest --output-on-failure --test-dir build

With Checking Memory Leaks

cmake . -B ./build -D LIBD4_BUILD_EXAMPLES=ON -D LIBD4_BUILD_TESTS=ON -D LIBD4_SANITIZER=ON
cmake --build build --config Debug
ctest --output-on-failure --test-dir build

With Docker

docker build -t libd4 .
docker run libd4

Contributing

See the guidelines for contributing.

Version

Starting from version 1.0.0 libd4 follows Semantic Versioning rules.

License

libd4 is distributed under the terms of MIT License, see LICENSE file for details.

About

Library designed to abstract most of The programming language code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages