Browse Source

Added imgui_single_file.h, We use this to validate compiling all *.cpp in same compilation unit.

Removed Unity builds stuff from example_null/. CI builds a temporary .cpp file.
pull/2975/head
Rokas Kupstys 5 years ago
committed by omar
parent
commit
f03c00bc89
  1. 25
      .github/workflows/build.yml
  2. 5
      docs/CHANGELOG.txt
  3. 5
      examples/example_null/Makefile
  4. 6
      examples/example_null/unity_build.cpp
  5. 17
      misc/single_file/imgui_single_file.h

25
.github/workflows/build.yml

@ -44,8 +44,13 @@ jobs:
- name: Build example_null (extra warnings)
run: mingw32-make -C examples/example_null EXTRA_WARNINGS=1
- name: Build example_null (unity build)
run: mingw32-make -C examples/example_null UNITY_BUILD=1
- name: Build example_null (single file build)
shell: bash
run: |
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
echo '#include "examples/example_null/main.cpp"' >> example_single_file.cpp
g++ -I. -Wall -Wformat -o example_single_file.exe example_single_file.cpp
- name: Build Win32 example_glfw_opengl2
shell: cmd
@ -176,8 +181,12 @@ jobs:
make -C examples/example_null clean
CXXFLAGS="$CXXFLAGS -m64" CXX=clang++ make -C examples/example_null EXTRA_WARNINGS=1
- name: Build example_null (unity build)
run: make -C examples/example_null UNITY_BUILD=1
- name: Build example_null (single file build)
run: |
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
echo '#include "examples/example_null/main.cpp"' >> example_single_file.cpp
g++ -I. -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_glfw_opengl2
run: make -C examples/example_glfw_opengl2
@ -208,8 +217,12 @@ jobs:
- name: Build example_null (extra warnings)
run: make -C examples/example_null EXTRA_WARNINGS=1
- name: Build example_null (unity build)
run: make -C examples/example_null UNITY_BUILD=1
- name: Build example_null (single file build)
run: |
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
echo '#include "examples/example_null/main.cpp"' >> example_single_file.cpp
clang++ -I. -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_glfw_opengl2
run: make -C examples/example_glfw_opengl2

5
docs/CHANGELOG.txt

@ -68,11 +68,14 @@ Other Changes:
- ColorEdit: In HSV display of a RGB stored value, attempt to locally preserve Saturation
when Value==0.0 (similar to changes done in 1.73 for Hue). Removed Hue editing lock since
those improvements in 1.73 makes them unnecessary. (#2722, #2770). [@rokups]
- Misc: Added ImGuiMouseCursor_NotAllowed enum so it can be used by more shared widgets. [@rokups]
- ImDrawList: Add AddNgon(), AddNgonFilled() API with a guarantee on the explicit segment count.
In the current branch they are essentially the same as AddCircle(), AddCircleFilled() but as
we will rework the circle rendering functions to use textures and automatic segment count
selection, those new api can fill a gap. [@ShironekoBen]
- Misc: Added ImGuiMouseCursor_NotAllowed enum so it can be used by more shared widgets. [@rokups]
- Misc: Added misc/single_file/imgui_single_file.h, We use this to validate compiling all *.cpp
files in a same compilation unit. Actual users of that technique (also called "Unity builds")
can generally provide this themselves, so we don't really recommend you use this. [@rokups]
- Backends: GLFW, SDL, Win32, OSX, Allegro: Added support for ImGuiMouseCursor_NotAllowed. [@rokups]
- Backends: GLFW: Added support for the missing mouse cursors newly added in GLFW 3.4+. [@rokups]
- Backends: SDL: Wayland: use SDL_GetMouseState (because there is no global mouse state available

5
examples/example_null/Makefile

@ -5,13 +5,8 @@
EXE = example_null
EXTRA_WARNINGS ?= 0
UNITY_BUILD ?= 0
ifeq ($(UNITY_BUILD), 1)
SOURCES = unity_build.cpp
else
SOURCES = main.cpp
SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp
endif
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s)

6
examples/example_null/unity_build.cpp

@ -1,6 +0,0 @@
// Unity build test - build this example as a single compilation unit.
#include "main.cpp"
#include "../../imgui.cpp"
#include "../../imgui_demo.cpp"
#include "../../imgui_draw.cpp"
#include "../../imgui_widgets.cpp"

17
misc/single_file/imgui_single_file.h

@ -0,0 +1,17 @@
// imgui_single_file.h
// We use this to validate compiling all *.cpp files in a same compilation unit.
// Users of that technique (also called "Unity builds") can generally provide this themselves,
// so we don't really recommend you use this in your projects.
// Do this:
// #define IMGUI_IMPLEMENTATION
// Before you include this file in *one* C++ file to create the implementation.
// Using this in your project will leak the contents of imgui_internal.h and ImVec2 operators in this compilation unit.
#include "../../imgui.h"
#ifdef IMGUI_IMPLEMENTATION
#include "../../imgui.cpp"
#include "../../imgui_demo.cpp"
#include "../../imgui_draw.cpp"
#include "../../imgui_widgets.cpp"
#endif
Loading…
Cancel
Save