Skip to content

Building the Application

github-actions[bot] edited this page Sep 30, 2026 · 6 revisions

BSC logo

GTK4/Adwaita Integration

In order for the application to run with the option for a graphical user interface (GUI), two Go-based GTK4/Adwaita package dependencies are required.

While these packages will get installed automatically during project setup, they require a one-time C-based local compilation, which can take ~15-20 minutes to complete. Please be patient.

For the curious, the package used by the Go language for managing C-based sources--such as those used in the GTK4 projects above--is called cgo.

Optional: Managing Cgo Runtime Warnings

As of this writing, a number of runtime warnings are generated by the cgo package which can visually interfere with the application runtime/logging output. If it's desired to suppress these compiler package warnings, be sure to set the following environment variable before building the application:

export CGO_CFLAGS="-w"

Note that this export is not required for a successful build: it simply removes any external package warnings from being displayed when running theble-sync-cycle executable

Finally... Compiling the Application

  1. Clone the repository and then change into the project directory:

    git clone https://github.com/richbl/go-ble-sync-cycle
    cd go-ble-sync-cycle
  2. Install Go package dependencies for the project:

    go mod tidy
  3. Build the application:

    go build -v ./cmd/ble-sync-cycle

    Note the use of the -v (or --verbose) flag. This is useful the very first time the application is compiled, as it can take time to compile the application (~15-20 minutes). While this flag is optional, it's helpful to visually track the progression of this lengthy build process

    To build an optimized executable (reduced binary size), run the following command:

    go build -ldflags="-s -w" -v ./cmd/ble-sync-cycle

    The resulting build command will create theble-sync-cycle executable in the current directory.

Clone this wiki locally