Skip to content

Commit

Permalink
Amend the CI builds to work with the new multiple realities of imgui.
Browse files Browse the repository at this point in the history
- Debian: distro package
- Ubuntu: distro package
- openSuse Leap: upstream submodule
- Fedora: upstream submodule

Additionally add the ability to pass in ENV to use the submodule on Linux.
  • Loading branch information
Rotonen committed Jul 19, 2023
1 parent 22c3864 commit 11704ab
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 19 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/pr-smoketest-debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
ca-certificates \
git \
${{ matrix.compiler }} \
make \
libboost-dev \
libboost-filesystem-dev \
libboost-locale-dev \
Expand All @@ -38,17 +39,15 @@ jobs:
libcairo2-dev \
libglew-dev \
libglm-dev \
libimgui-dev \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libvorbis-dev \
make
libvorbis-dev
- name: Checkout Anura
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: true

- name: Build Anura
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-smoketest-fedora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:

- name: Build Anura
env:
IMGUI: local
CXX: ${{ matrix.compiler }}
# Number of cores * 3
run: make -j "$(($(getconf _NPROCESSORS_ONLN) * 3))"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-smoketest-opensuse-leap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ jobs:
- name: Checkout Anura
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: true
submodules: true

- name: Build Anura
env:
IMGUI: local
CXX: ${{ matrix.compiler }}
# Number of cores * 3
run: make -j "$(($(getconf _NPROCESSORS_ONLN) * 3))"
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/pr-smoketest-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
ca-certificates \
git \
${{ matrix.compiler }} \
make \
libboost-dev \
libboost-filesystem-dev \
libboost-locale-dev \
Expand All @@ -35,17 +36,15 @@ jobs:
libcairo2-dev \
libglew-dev \
libglm-dev \
libimgui-dev \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libvorbis-dev \
make
libvorbis-dev
- name: Checkout Anura
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: true

- name: Build Anura
env:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/push-unit-tests-dynamic-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
ca-certificates \
git \
clang \
make \
libboost-dev \
libboost-filesystem-dev \
libboost-locale-dev \
Expand All @@ -24,17 +25,15 @@ jobs:
libcairo2-dev \
libglew-dev \
libglm-dev \
libimgui-dev \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libvorbis-dev \
make
libvorbis-dev
- name: Checkout Anura
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: true

- name: Build Anura
env:
Expand Down
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,25 @@ OBJ := $(patsubst src/%.cpp,./build/%.o,$(SRC))
DEPS := $(patsubst src/%.cpp,./build/%.d,$(SRC))
INCLUDES := $(addprefix -I,$(SRC_DIR))

# Allow to manually say we use the submodule
IMGUI?=library
ifeq ($(IMGUI),local)
BASE_CXXFLAGS += -DLOCAL_IMGUI
INC += -Iimgui
SRC += imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui_widgets.cpp
OBJ += imgui/imgui.o imgui/imgui_draw.o imgui/imgui_widgets.o
SRC_DIR += ./imgui
else
INC += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags imgui)
LIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs imgui)
endif

# Make it possible to inject this variable from ENV
export IMGUI

# Compilation injection of our extensions of imgui
CPPFLAGS += -DIMGUI_USER_CONFIG=\"$(abspath src/imgui_additions/imconfig.h)\"
INC += $(shell pkg-config --cflags imgui)
LIBS += $(shell pkg-config --libs imgui)


vpath %.cpp $(SRC_DIR)

Expand Down
2 changes: 1 addition & 1 deletion src/imgui_additions/imgui_custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "spline_simple.h"

#include <cmath>
#if !defined(_MSC_VER) && !defined(__APPLE__ )
#if !defined(_MSC_VER) && !defined(__APPLE__ ) && !defined(LOCAL_IMGUI)
#include <imgui/imgui_internal.h>
#else
#include <imgui_internal.h>
Expand Down
2 changes: 1 addition & 1 deletion src/imgui_additions/imgui_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#pragma once

#if !defined(_MSC_VER) && !defined(__APPLE__ )
#if !defined(_MSC_VER) && !defined(__APPLE__ ) && !defined(LOCAL_IMGUI)
#include <imgui/imgui.h>
#else
#include <imgui.h>
Expand Down
2 changes: 1 addition & 1 deletion src/kre/imgui_impl_sdl_gl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#pragma once

#if !defined(_MSC_VER) && !defined(__APPLE__ )
#if !defined(_MSC_VER) && !defined(__APPLE__ ) && !defined(LOCAL_IMGUI)
#include <imgui/imgui.h>
#else
#include <imgui.h>
Expand Down
2 changes: 1 addition & 1 deletion src/theme_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "theme_imgui.hpp"

#if !defined(_MSC_VER) && !defined(__APPLE__ )
#if !defined(_MSC_VER) && !defined(__APPLE__ ) && !defined(LOCAL_IMGUI)
#include <imgui/imgui.h>
#else
#include <imgui.h>
Expand Down

0 comments on commit 11704ab

Please sign in to comment.