File: overview.md

package info (click to toggle)
foundry 1.1~beta-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,552 kB
  • sloc: ansic: 167,487; xml: 417; makefile: 21; sh: 19; javascript: 10
file content (55 lines) | stat: -rw-r--r-- 1,495 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Title: Overview

# Overview

Foundry is a [GNOME](https://www.gnome.org/) library and command line tool
to implement IDE functionality across a variety of packging and build systems,
language servers, linters, debuggers, simulators, devices, and more.

## Building

In your C sources, include libfoundry using `<foundry.h>` like the following.

```c
#include <foundry.h>
```

To build a program that uses Foundry, you can use the following command to get
the cflags and libraries necessary to compile and link.

```sh
cc hello.c $(pkg-config --cflags --libs libfoundry-1) -o hello
```

## Version Checks

You can check the version of libfoundry at compile time using the version
checking macros.

```c
#if FOUNDRY_CHECK_VERSION(1, 0, 0)
  /* version specific code here */
#endif
```

## Feature Flags

Foundry has a number of features that are in development and my not be
stablized in the release of Foundry you are consuming. You can check for
feature availability at compile time using the appropriate `#ifdef`.

The feature flags are defined in the `libfoundry-config.h` installed into
your library directory, similar to glib's `glib-config.h`.

```c
#include <foundry.h>

#ifdef FOUNDRY_FEATURE_DEBUGGER
  /* Use Debugger Specific APIs */
#endif
```

In most cases it is advised for applications to control their libfoundry
library and feature flags and that is preferred over conditional checks.
This may mean statically linking libfoundry or building it as a shared
library in a Flatpak.