Skip to content

Commit 0b20db9

Browse files
Merge pull request #2834 from AlexandreSinger/feature-ci-noble-upgrade
[CI] Added GCC-13 on Ubuntu Noble as a Compatibility Test
2 parents c954e57 + 365f7da commit 0b20db9

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,37 @@ jobs:
471471
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
472472
./.github/scripts/build.sh
473473
474+
NobleCompatibility:
475+
name: 'Ubuntu Noble - 24.04 Compatibility Test'
476+
runs-on: ubuntu-24.04
477+
steps:
478+
- uses: actions/setup-python@v5
479+
with:
480+
python-version: 3.12.3
481+
482+
- uses: actions/checkout@v4
483+
with:
484+
submodules: 'true'
485+
486+
- name: Get number of CPU cores
487+
uses: SimenB/github-actions-cpu-cores@v2
488+
id: cpu-cores
489+
490+
- name: Install Dependencies
491+
run: ./.github/scripts/install_noble_dependencies.sh
492+
493+
- uses: hendrikmuhs/[email protected]
494+
495+
- name: Test
496+
env:
497+
CMAKE_PARAMS: "-DVTR_ASSERT_LEVEL=3 -DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_IPO_BUILD=off"
498+
MATRIX_EVAL: 'CC=gcc-13 && CXX=g++-13'
499+
BUILD_TYPE: release
500+
NUM_PROC: ${{ steps.cpu-cores.outputs.count }}
501+
run: |
502+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
503+
./.github/scripts/build.sh
504+
474505
Coverity:
475506
name: 'Coverity Scan'
476507
needs:

libs/EXTERNAL/libezgl/src/application.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818

1919
#include "ezgl/application.hpp"
2020

21+
// GLib deprecated G_APPLICATION_FLAGS_NONE and replaced it with G_APPLICATION_DEFAULT_FLAGS,
22+
// however, this enum was not introduced until GLib 2.74. These lines of code allow EZGL
23+
// to be backwards compatible with older versions of GLib, while not using the deprecated
24+
// enum.
25+
#if GLIB_CHECK_VERSION(2, 74, 0)
26+
static constexpr GApplicationFlags EZGL_APPLICATION_DEFAULT_FLAGS = G_APPLICATION_DEFAULT_FLAGS;
27+
#else
28+
static constexpr GApplicationFlags EZGL_APPLICATION_DEFAULT_FLAGS = G_APPLICATION_FLAGS_NONE;
29+
#endif
30+
2131
namespace ezgl {
2232

2333
// A flag to disable event loop (default is false)
@@ -86,7 +96,7 @@ application::application(application::settings s)
8696
, m_window_id(s.window_identifier)
8797
, m_canvas_id(s.canvas_identifier)
8898
, m_application_id(s.application_identifier)
89-
, m_application(gtk_application_new(s.application_identifier.c_str(), G_APPLICATION_FLAGS_NONE))
99+
, m_application(gtk_application_new(s.application_identifier.c_str(), EZGL_APPLICATION_DEFAULT_FLAGS))
90100
, m_builder(gtk_builder_new())
91101
, m_register_callbacks(s.setup_callbacks)
92102
{
@@ -205,7 +215,7 @@ int application::run(setup_callback_fn initial_setup_user_callback,
205215
g_object_unref(m_builder);
206216

207217
// Reconstruct the GTK application
208-
m_application = (gtk_application_new(m_application_id.c_str(), G_APPLICATION_FLAGS_NONE));
218+
m_application = (gtk_application_new(m_application_id.c_str(), EZGL_APPLICATION_DEFAULT_FLAGS));
209219
m_builder = (gtk_builder_new());
210220
g_signal_connect(m_application, "startup", G_CALLBACK(startup), this);
211221
g_signal_connect(m_application, "activate", G_CALLBACK(activate), this);
@@ -478,4 +488,4 @@ void set_disable_event_loop(bool new_setting)
478488
{
479489
disable_event_loop = new_setting;
480490
}
481-
}
491+
}

0 commit comments

Comments
 (0)