## IdeRuntime IdeRuntime |

## Functions

GQuark | ide_runtime_error_quark ()
gboolean | ide_runtime_contains_program_in_path ()
IdeSubprocessLauncher * | ide_runtime_create_launcher ()
IdeRunner * | ide_runtime_create_runner ()
void | ide_runtime_prepare_configuration ()
IdeRuntime * | ide_runtime_new ()
const gchar * | ide_runtime_get_id ()
void | ide_runtime_set_id ()
const gchar * | ide_runtime_get_category ()
void | ide_runtime_set_category ()
const gchar * | ide_runtime_get_display_name ()
void | ide_runtime_set_display_name ()
const gchar * | ide_runtime_get_name ()
void | ide_runtime_set_name ()
GFile * | ide_runtime_translate_file ()
gchar ** | ide_runtime_get_system_include_dirs ()
gchar * | ide_runtime_get_arch ()
IdeTriplet * | ide_runtime_get_triplet ()
gboolean | ide_runtime_supports_toolchain ()

## Properties

gchar * | category | Read / Write / Construct
gchar * | display-name | Read / Write / Construct
gchar * | id | Read / Write / Construct
gchar * | name | Read / Write / Construct

## Types and Values

enum | IdeRuntimeError
#define | IDE_TYPE_RUNTIME
#define | IDE_RUNTIME_ERROR
struct | IdeRuntimeClass
| IdeRuntime

## Object Hierarchy

        GEnum
        ╰── IdeRuntimeError
        GObject
        ╰── IdeObject
            ╰── IdeRuntime

## Description

## Functions

### ide_runtime_error_quark ()

    GQuark
    ide_runtime_error_quark (void);

### ide_runtime_contains_program_in_path ()

    gboolean
    ide_runtime_contains_program_in_path (IdeRuntime *self,
                                          const gchar *program,
                                          GCancellable *cancellable);

### ide_runtime_create_launcher ()

    IdeSubprocessLauncher *
    ide_runtime_create_launcher (IdeRuntime *self,
                                 GError **error);

Creates a launcher for the runtime.

This can be used to execute a command within a runtime.

It is important that this function can be run from a thread without side effects.

#### Returns

An IdeSubprocessLauncher or `NULL` upon failure.

[transfer full]

Since: 3.32

### ide_runtime_create_runner ()

    IdeRunner *
    ide_runtime_create_runner (IdeRuntime *self,
                               IdeBuildTarget *build_target);

Creates a new runner that can be used to execute the build target within the runtime. This should be used to implement such features as "run target" or "run unit test" inside the target runtime.

If `build_target` is `NULL`, the runtime should create a runner that allows the caller to specify the binary using the IdeRunner API.

#### Parameters

self | An IdeRuntime |
build_target | An IdeBuildTarget or `NULL`. | [nullable]

#### Returns

An IdeRunner if successful, otherwise `NULL` and `error` is set.

[transfer full][nullable]

Since: 3.32

### ide_runtime_prepare_configuration ()

    void
    ide_runtime_prepare_configuration (IdeRuntime *self,
                                       IdeConfig *configuration);

### ide_runtime_new ()

    IdeRuntime *
    ide_runtime_new (const gchar *id,
                     const gchar *title);

### ide_runtime_get_id ()

    const gchar *
    ide_runtime_get_id (IdeRuntime *self);

### ide_runtime_set_id ()

    void
    ide_runtime_set_id (IdeRuntime *self,
                        const gchar *id);

### ide_runtime_get_category ()

    const gchar *
    ide_runtime_get_category (IdeRuntime *self);

### ide_runtime_set_category ()

    void
    ide_runtime_set_category (IdeRuntime *self,
                              const gchar *category);

### ide_runtime_get_display_name ()

    const gchar *
    ide_runtime_get_display_name (IdeRuntime *self);

### ide_runtime_set_display_name ()

    void
    ide_runtime_set_display_name (IdeRuntime *self,
                                  const gchar *display_name);

### ide_runtime_get_name ()

    const gchar *
    ide_runtime_get_name (IdeRuntime *self);

### ide_runtime_set_name ()

    void
    ide_runtime_set_name (IdeRuntime *self,
                          const gchar *name);

### ide_runtime_translate_file ()

    GFile *
    ide_runtime_translate_file (IdeRuntime *self,
                                GFile *file);

Translates the file from a path within the runtime to a path that can be accessed from the host system.

#### Parameters

self | An IdeRuntime |
file | a GFile |

#### Returns

a GFile.

[transfer full][not nullable]

Since: 3.32

### ide_runtime_get_system_include_dirs ()

    gchar **
    ide_runtime_get_system_include_dirs (IdeRuntime *self);

Gets the system include dirs for the runtime. Usually, this is just "/usr/include", but more complex runtimes may include additional.

#### Parameters

self | a IdeRuntime |

#### Returns

A newly allocated string containing the include dirs.

[transfer full][array zero-terminated=1]

Since: 3.32

### ide_runtime_get_arch ()

    gchar *
    ide_runtime_get_arch (IdeRuntime *self);

Gets the architecture of the runtime.

This can be used to ensure we're compiling for the right architecture given the current device.

This is strictly equivalent to calling ide_triplet_get_arch on the result of ide_runtime_get_triplet.

#### Parameters

self | a IdeRuntime |

#### Returns

the name of the architecture the runtime will build for.

[transfer full][not nullable]

Since: 3.32

### ide_runtime_get_triplet ()

    IdeTriplet *
    ide_runtime_get_triplet (IdeRuntime *self);

Gets the architecture triplet of the runtime.

This can be used to ensure we're compiling for the right architecture given the current device.

#### Parameters

self | a IdeRuntime |

#### Returns

the architecture triplet the runtime will build for.

[transfer full][not nullable]

Since: 3.32

### ide_runtime_supports_toolchain ()

    gboolean
    ide_runtime_supports_toolchain (IdeRuntime *self,
                                    IdeToolchain *toolchain);

Informs wether a toolchain is supported by this.

#### Parameters

self | a IdeRuntime |
toolchain | the IdeToolchain to check |

#### Returns

`TRUE` if the toolchain is supported

Since: 3.32

## Types and Values

### enum IdeRuntimeError

#### Members

IDE_RUNTIME_ERROR_UNKNOWN |  |
IDE_RUNTIME_ERROR_NO_SUCH_RUNTIME |  |
IDE_RUNTIME_ERROR_BUILD_FAILED |  |
IDE_RUNTIME_ERROR_TARGET_NOT_FOUND |  |
IDE_RUNTIME_ERROR_SPAWN_FAILED |  |

### IDE_TYPE_RUNTIME

    #define IDE_TYPE_RUNTIME (ide_runtime_get_type())

### IDE_RUNTIME_ERROR

    #define IDE_RUNTIME_ERROR (ide_runtime_error_quark())

### struct IdeRuntimeClass

    struct IdeRuntimeClass {
      IdeObjectClass parent;

      gboolean                (*contains_program_in_path) (IdeRuntime           *self,
                                                           const gchar          *program,
                                                           GCancellable         *cancellable);
      IdeSubprocessLauncher  *(*create_launcher)          (IdeRuntime           *self,
                                                           GError              **error);
      void                    (*prepare_configuration)    (IdeRuntime           *self,
                                                           IdeConfig     *configuration);
      IdeRunner              *(*create_runner)            (IdeRuntime           *self,
                                                           IdeBuildTarget       *build_target);
      GFile                  *(*translate_file)           (IdeRuntime           *self,
                                                           GFile                *file);
      gchar                 **(*get_system_include_dirs)  (IdeRuntime           *self);
      IdeTriplet             *(*get_triplet)              (IdeRuntime           *self);
      gboolean                (*supports_toolchain)       (IdeRuntime           *self,
                                                           IdeToolchain         *toolchain);
    };

### IdeRuntime

    typedef struct _IdeRuntime IdeRuntime;

## Property Details

### The `“category”` property

      “category”                 gchar *

The runtime's category.

Owner: IdeRuntime

Flags: Read / Write / Construct

Default value: NULL

### The `“display-name”` property

      “display-name”             gchar *

Display Name.

Owner: IdeRuntime

Flags: Read / Write / Construct

Default value: NULL

### The `“id”` property

      “id”                       gchar *

The runtime identifier.

Owner: IdeRuntime

Flags: Read / Write / Construct

Default value: NULL

### The `“name”` property

      “name”                     gchar *

Name.

Owner: IdeRuntime

Flags: Read / Write / Construct

Default value: NULL