IdeRuntime

IdeRuntime

Functions

Properties

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

Types and Values

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]


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]


ide_runtime_prepare_configuration ()

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

ide_runtime_new ()

IdeRuntime *
ide_runtime_new (IdeContext *context,
                 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_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_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]


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.28


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.28


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.30


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.30

Types and Values

enum IdeRuntimeError

Members

IDE_RUNTIME_ERROR_NO_SUCH_RUNTIME

   

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,
                                                       IdeConfiguration     *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);

  gpointer _reserved[12];
};

IdeRuntime

typedef struct _IdeRuntime IdeRuntime;

Property Details

The “display-name” property

  “display-name”             gchar *

Display Name.

Flags: Read / Write / Construct

Default value: NULL


The “id” property

  “id”                       gchar *

The runtime identifier.

Flags: Read / Write / Construct

Default value: NULL