IdeBuildTarget: Builder SDK Reference

## IdeBuildTarget IdeBuildTarget |

## Functions

GFile * | ide_build_target_get_install_directory ()
gchar * | ide_build_target_get_name ()
gint | ide_build_target_get_priority ()
gchar ** | ide_build_target_get_argv ()
gchar * | ide_build_target_get_cwd ()
gchar * | ide_build_target_get_language ()
gboolean | ide_build_target_compare ()

## Types and Values

#define | IDE_TYPE_BUILD_TARGET
struct | IdeBuildTargetInterface
| IdeBuildTarget

## Object Hierarchy

        GInterface
        ╰── IdeBuildTarget

## Prerequisites

IdeBuildTarget requires IdeObject.

## Description

## Functions

### ide_build_target_get_install_directory ()

    GFile *
    ide_build_target_get_install_directory
                                   (IdeBuildTarget *self);

#### Returns

a GFile or `NULL`.

[nullable][transfer full]

### ide_build_target_get_name ()

    gchar *
    ide_build_target_get_name (IdeBuildTarget *self);

#### Returns

A filename or `NULL`.

[nullable][transfer full]

### ide_build_target_get_priority ()

    gint
    ide_build_target_get_priority (IdeBuildTarget *self);

Gets the priority of the build target. This is used to sort build targets by their importance. The lowest value (negative values are allowed) will be run as the default run target by Builder.

#### Parameters

self | an IdeBuildTarget |

#### Returns

the priority of the build target

Since: 3.28

### ide_build_target_get_argv ()

    gchar **
    ide_build_target_get_argv (IdeBuildTarget *self);

Gets the arguments used to run the target.

#### Parameters

self | a IdeBuildTarget |

#### Returns

A GStrv containing the arguments to run the target.

[transfer full]

Since: 3.28

### ide_build_target_get_cwd ()

    gchar *
    ide_build_target_get_cwd (IdeBuildTarget *self);

For build systems and build target providers that insist to be run in a specific place, this method gets the correct working directory.

If this method returns `NULL`, the runtime will pick a default working directory for the spawned process (usually, the user home directory in the host system, or the flatpak sandbox home under flatpak).

#### Parameters

self | a IdeBuildTarget |

#### Returns

the working directory to use for this target.

[nullable][transfer full]

Since: 3.28

### ide_build_target_get_language ()

    gchar *
    ide_build_target_get_language (IdeBuildTarget *self);

Return the main programming language that was used to write this build target.

This method is primarily used to choose an appropriate debugger. Therefore, if a build target is composed of components in multiple language (eg. a GJS app with GObject Introspection libraries, or a Java app with JNI libraries), this should return the language that is most likely to be appropriate for debugging.

The default implementation returns "asm", which indicates an unspecified language that compiles to native code.

#### Parameters

self | a IdeBuildTarget |

#### Returns

the programming language of this target.

[transfer full]

Since: 3.28

### ide_build_target_compare ()

    gboolean
    ide_build_target_compare (const IdeBuildTarget *left,
                              const IdeBuildTarget *right);

## Types and Values

### IDE_TYPE_BUILD_TARGET

    #define IDE_TYPE_BUILD_TARGET (ide_build_target_get_type())

### struct IdeBuildTargetInterface

    struct IdeBuildTargetInterface {
      GTypeInterface parent_iface;

      GFile  *(*get_install_directory) (IdeBuildTarget *self);
      gchar  *(*get_name)              (IdeBuildTarget *self);
      gint    (*get_priority)          (IdeBuildTarget *self);
      gchar **(*get_argv)              (IdeBuildTarget *self);
      gchar  *(*get_cwd)               (IdeBuildTarget *self);
      gchar  *(*get_language)          (IdeBuildTarget *self);
    };

### IdeBuildTarget

    typedef struct _IdeBuildTarget IdeBuildTarget;