| 1 |
name: build |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
pull_request: |
| 6 |
workflow_run: |
| 7 |
# Use a workflow as a trigger of scheduled builds. Forked repositories can disable scheduled builds by disabling |
| 8 |
# "scheduled" workflow, while maintaining ability to perform local CI builds. |
| 9 |
workflows: |
| 10 |
- scheduled |
| 11 |
- manual |
| 12 |
branches: |
| 13 |
- master |
| 14 |
- docking |
| 15 |
types: |
| 16 |
- requested |
| 17 |
|
| 18 |
jobs: |
| 19 |
Windows: |
| 20 |
runs-on: windows-2019 |
| 21 |
env: |
| 22 |
VS_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\ |
| 23 |
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\ |
| 24 |
steps: |
| 25 |
- uses: actions/checkout@v4 |
| 26 |
|
| 27 |
- name: Install Dependencies |
| 28 |
shell: powershell |
| 29 |
run: | |
| 30 |
Invoke-WebRequest -Uri "https://www.libsdl.org/release/SDL2-devel-2.26.3-VC.zip" -OutFile "SDL2-devel-2.26.3-VC.zip" |
| 31 |
Expand-Archive -Path SDL2-devel-2.26.3-VC.zip |
| 32 |
echo "SDL2_DIR=$(pwd)\SDL2-devel-2.26.3-VC\SDL2-2.26.3\" >>${env:GITHUB_ENV} |
| 33 |
|
| 34 |
Invoke-WebRequest -Uri "https://github.com/ocornut/imgui/files/3789205/vulkan-sdk-1.1.121.2.zip" -OutFile vulkan-sdk-1.1.121.2.zip |
| 35 |
Expand-Archive -Path vulkan-sdk-1.1.121.2.zip |
| 36 |
echo "VULKAN_SDK=$(pwd)\vulkan-sdk-1.1.121.2\" >>${env:GITHUB_ENV} |
| 37 |
|
| 38 |
- name: Fix Projects |
| 39 |
shell: powershell |
| 40 |
run: | |
| 41 |
# CI workers do not supporter older Visual Studio versions. Fix projects to target newer available version. |
| 42 |
gci -recurse -filter "*.vcxproj" | ForEach-Object { |
| 43 |
(Get-Content $_.FullName) -Replace "<PlatformToolset>v\d{3}</PlatformToolset>","<PlatformToolset>v142</PlatformToolset>" | Set-Content -Path $_.FullName |
| 44 |
(Get-Content $_.FullName) -Replace "<WindowsTargetPlatformVersion>[\d\.]+</WindowsTargetPlatformVersion>","<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>" | Set-Content -Path $_.FullName |
| 45 |
} |
| 46 |
|
| 47 |
# Not using matrix here because it would inflate job count too much. Check out and setup is done for every job and that makes build times way too long. |
| 48 |
- name: Build example_null (extra warnings, mingw 64-bit) |
| 49 |
run: mingw32-make -C examples/example_null WITH_EXTRA_WARNINGS=1 |
| 50 |
|
| 51 |
- name: Build example_null (mingw 64-bit, as DLL) |
| 52 |
shell: bash |
| 53 |
run: | |
| 54 |
echo '#ifdef _EXPORT' > example_single_file.cpp |
| 55 |
echo '# define IMGUI_API __declspec(dllexport)' >> example_single_file.cpp |
| 56 |
echo '#else' >> example_single_file.cpp |
| 57 |
echo '# define IMGUI_API __declspec(dllimport)' >> example_single_file.cpp |
| 58 |
echo '#endif' >> example_single_file.cpp |
| 59 |
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp |
| 60 |
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp |
| 61 |
g++ -I. -Wall -Wformat -D_EXPORT -shared -o libimgui.dll -Wl,--out-implib,libimgui.a example_single_file.cpp -limm32 |
| 62 |
g++ -I. -Wall -Wformat -o example_null.exe examples/example_null/main.cpp -L. -limgui |
| 63 |
rm -f example_null.exe libimgui.* example_single_file.* |
| 64 |
|
| 65 |
- name: Build example_null (extra warnings, msvc 64-bit) |
| 66 |
shell: cmd |
| 67 |
run: | |
| 68 |
cd examples\example_null |
| 69 |
call "%VS_PATH%\VC\Auxiliary\Build\vcvars64.bat" |
| 70 |
.\build_win32.bat /W4 |
| 71 |
|
| 72 |
- name: Build example_null (single file build) |
| 73 |
shell: bash |
| 74 |
run: | |
| 75 |
cat > example_single_file.cpp <<'EOF' |
| 76 |
|
| 77 |
#define IMGUI_IMPLEMENTATION |
| 78 |
#include "misc/single_file/imgui_single_file.h" |
| 79 |
#include "examples/example_null/main.cpp" |
| 80 |
|
| 81 |
EOF |
| 82 |
g++ -I. -Wall -Wformat -o example_single_file.exe example_single_file.cpp -limm32 |
| 83 |
|
| 84 |
- name: Build example_null (with IMGUI_DISABLE_WIN32_FUNCTIONS) |
| 85 |
shell: bash |
| 86 |
run: | |
| 87 |
cat > example_single_file.cpp <<'EOF' |
| 88 |
|
| 89 |
#define IMGUI_DISABLE_WIN32_FUNCTIONS |
| 90 |
#define IMGUI_IMPLEMENTATION |
| 91 |
#include "misc/single_file/imgui_single_file.h" |
| 92 |
#include "examples/example_null/main.cpp" |
| 93 |
|
| 94 |
EOF |
| 95 |
g++ -I. -Wall -Wformat -o example_single_file.exe example_single_file.cpp -limm32 |
| 96 |
|
| 97 |
- name: Build example_null (as DLL) |
| 98 |
shell: cmd |
| 99 |
run: | |
| 100 |
call "%VS_PATH%\VC\Auxiliary\Build\vcvars64.bat" |
| 101 |
|
| 102 |
echo #ifdef _EXPORT > example_single_file.cpp |
| 103 |
echo # define IMGUI_API __declspec(dllexport) >> example_single_file.cpp |
| 104 |
echo #else >> example_single_file.cpp |
| 105 |
echo # define IMGUI_API __declspec(dllimport) >> example_single_file.cpp |
| 106 |
echo #endif >> example_single_file.cpp |
| 107 |
echo #define IMGUI_IMPLEMENTATION >> example_single_file.cpp |
| 108 |
echo #include "misc/single_file/imgui_single_file.h" >> example_single_file.cpp |
| 109 |
|
| 110 |
cl.exe /D_USRDLL /D_WINDLL /D_EXPORT /I. example_single_file.cpp /LD /FeImGui.dll /link |
| 111 |
cl.exe /I. ImGui.lib /Feexample_null.exe examples/example_null/main.cpp |
| 112 |
|
| 113 |
- name: Build Win32 example_glfw_opengl2 |
| 114 |
shell: cmd |
| 115 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 116 |
|
| 117 |
- name: Build Win32 example_glfw_opengl3 |
| 118 |
shell: cmd |
| 119 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 120 |
if: github.event_name == 'workflow_run' |
| 121 |
|
| 122 |
- name: Build Win32 example_glfw_vulkan |
| 123 |
shell: cmd |
| 124 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 125 |
if: github.event_name == 'workflow_run' |
| 126 |
|
| 127 |
- name: Build Win32 example_sdl2_sdlrenderer2 |
| 128 |
shell: cmd |
| 129 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 130 |
if: github.event_name == 'workflow_run' |
| 131 |
|
| 132 |
- name: Build Win32 example_sdl2_vulkan |
| 133 |
shell: cmd |
| 134 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 135 |
if: github.event_name == 'workflow_run' |
| 136 |
|
| 137 |
- name: Build Win32 example_sdl2_opengl2 |
| 138 |
shell: cmd |
| 139 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 140 |
if: github.event_name == 'workflow_run' |
| 141 |
|
| 142 |
- name: Build Win32 example_sdl2_opengl3 |
| 143 |
shell: cmd |
| 144 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 145 |
|
| 146 |
- name: Build Win32 example_sdl2_directx11 |
| 147 |
shell: cmd |
| 148 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 149 |
if: github.event_name == 'workflow_run' |
| 150 |
|
| 151 |
- name: Build Win32 example_win32_directx9 |
| 152 |
shell: cmd |
| 153 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx9/example_win32_directx9.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 154 |
|
| 155 |
- name: Build Win32 example_win32_directx10 |
| 156 |
shell: cmd |
| 157 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx10/example_win32_directx10.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 158 |
|
| 159 |
- name: Build Win32 example_win32_directx11 |
| 160 |
shell: cmd |
| 161 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx11/example_win32_directx11.vcxproj /p:Platform=Win32 /p:Configuration=Release' |
| 162 |
if: github.event_name == 'workflow_run' |
| 163 |
|
| 164 |
- name: Build x64 example_glfw_opengl2 |
| 165 |
shell: cmd |
| 166 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 167 |
if: github.event_name == 'workflow_run' |
| 168 |
|
| 169 |
- name: Build x64 example_glfw_opengl3 |
| 170 |
shell: cmd |
| 171 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 172 |
|
| 173 |
- name: Build x64 example_glfw_vulkan |
| 174 |
shell: cmd |
| 175 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 176 |
|
| 177 |
- name: Build x64 example_sdl2_sdlrenderer2 |
| 178 |
shell: cmd |
| 179 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 180 |
if: github.event_name == 'workflow_run' |
| 181 |
|
| 182 |
- name: Build x64 example_sdl2_vulkan |
| 183 |
shell: cmd |
| 184 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 185 |
if: github.event_name == 'workflow_run' |
| 186 |
|
| 187 |
- name: Build x64 example_sdl2_opengl2 |
| 188 |
shell: cmd |
| 189 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 190 |
if: github.event_name == 'workflow_run' |
| 191 |
|
| 192 |
- name: Build x64 example_sdl2_opengl3 |
| 193 |
shell: cmd |
| 194 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 195 |
if: github.event_name == 'workflow_run' |
| 196 |
|
| 197 |
- name: Build x64 example_sdl2_directx11 |
| 198 |
shell: cmd |
| 199 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 200 |
|
| 201 |
- name: Build x64 example_win32_directx9 |
| 202 |
shell: cmd |
| 203 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx9/example_win32_directx9.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 204 |
if: github.event_name == 'workflow_run' |
| 205 |
|
| 206 |
- name: Build x64 example_win32_directx10 |
| 207 |
shell: cmd |
| 208 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx10/example_win32_directx10.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 209 |
if: github.event_name == 'workflow_run' |
| 210 |
|
| 211 |
- name: Build x64 example_win32_directx11 |
| 212 |
shell: cmd |
| 213 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx11/example_win32_directx11.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 214 |
if: github.event_name == 'workflow_run' |
| 215 |
|
| 216 |
- name: Build x64 example_win32_directx12 |
| 217 |
shell: cmd |
| 218 |
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release' |
| 219 |
|
| 220 |
Linux: |
| 221 |
runs-on: ubuntu-24.04 |
| 222 |
steps: |
| 223 |
- uses: actions/checkout@v4 |
| 224 |
|
| 225 |
- name: Install Dependencies |
| 226 |
run: | |
| 227 |
sudo apt-get update |
| 228 |
sudo apt-get install -y libglfw3-dev libsdl2-dev gcc-multilib g++-multilib libfreetype6-dev libvulkan-dev |
| 229 |
|
| 230 |
- name: Build example_null (extra warnings, gcc 32-bit) |
| 231 |
run: | |
| 232 |
make -C examples/example_null clean |
| 233 |
CXXFLAGS="$CXXFLAGS -m32 -Werror" make -C examples/example_null WITH_EXTRA_WARNINGS=1 |
| 234 |
|
| 235 |
- name: Build example_null (extra warnings, gcc 64-bit) |
| 236 |
run: | |
| 237 |
make -C examples/example_null clean |
| 238 |
CXXFLAGS="$CXXFLAGS -m64 -Werror" make -C examples/example_null WITH_EXTRA_WARNINGS=1 |
| 239 |
|
| 240 |
- name: Build example_null (extra warnings, clang 32-bit) |
| 241 |
run: | |
| 242 |
make -C examples/example_null clean |
| 243 |
CXXFLAGS="$CXXFLAGS -m32 -Werror" CXX=clang++ make -C examples/example_null WITH_EXTRA_WARNINGS=1 |
| 244 |
|
| 245 |
- name: Build example_null (extra warnings, clang 64-bit) |
| 246 |
run: | |
| 247 |
make -C examples/example_null clean |
| 248 |
CXXFLAGS="$CXXFLAGS -m64 -Werror" CXX=clang++ make -C examples/example_null WITH_EXTRA_WARNINGS=1 |
| 249 |
|
| 250 |
- name: Build example_null (extra warnings, empty IM_ASSERT) |
| 251 |
run: | |
| 252 |
cat > example_single_file.cpp <<'EOF' |
| 253 |
|
| 254 |
#define IM_ASSERT(x) |
| 255 |
#define IMGUI_IMPLEMENTATION |
| 256 |
#include "misc/single_file/imgui_single_file.h" |
| 257 |
#include "examples/example_null/main.cpp" |
| 258 |
|
| 259 |
EOF |
| 260 |
g++ -I. -std=c++11 -Wall -Wformat -Wextra -Werror -Wno-zero-as-null-pointer-constant -Wno-double-promotion -Wno-variadic-macros -Wno-empty-body -o example_single_file example_single_file.cpp |
| 261 |
|
| 262 |
- name: Build example_null (freetype) |
| 263 |
run: | |
| 264 |
make -C examples/example_null clean |
| 265 |
make -C examples/example_null WITH_FREETYPE=1 |
| 266 |
|
| 267 |
- name: Build example_null (single file build) |
| 268 |
run: | |
| 269 |
cat > example_single_file.cpp <<'EOF' |
| 270 |
|
| 271 |
#define IMGUI_IMPLEMENTATION |
| 272 |
#include "misc/single_file/imgui_single_file.h" |
| 273 |
#include "examples/example_null/main.cpp" |
| 274 |
|
| 275 |
EOF |
| 276 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 277 |
|
| 278 |
- name: Build example_null (with ImWchar32) |
| 279 |
run: | |
| 280 |
cat > example_single_file.cpp <<'EOF' |
| 281 |
|
| 282 |
#define IMGUI_USE_WCHAR32 |
| 283 |
#define IMGUI_IMPLEMENTATION |
| 284 |
#include "misc/single_file/imgui_single_file.h" |
| 285 |
#include "examples/example_null/main.cpp" |
| 286 |
|
| 287 |
EOF |
| 288 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 289 |
|
| 290 |
- name: Build example_null (with large ImDrawIdx + pointer ImTextureID) |
| 291 |
run: | |
| 292 |
cat > example_single_file.cpp <<'EOF' |
| 293 |
|
| 294 |
#define ImTextureID void* |
| 295 |
#define ImDrawIdx unsigned int |
| 296 |
#define IMGUI_IMPLEMENTATION |
| 297 |
#include "misc/single_file/imgui_single_file.h" |
| 298 |
#include "examples/example_null/main.cpp" |
| 299 |
|
| 300 |
EOF |
| 301 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 302 |
|
| 303 |
- name: Build example_null (with IMGUI_DISABLE_OBSOLETE_FUNCTIONS) |
| 304 |
run: | |
| 305 |
cat > example_single_file.cpp <<'EOF' |
| 306 |
|
| 307 |
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS |
| 308 |
#define IMGUI_IMPLEMENTATION |
| 309 |
#include "misc/single_file/imgui_single_file.h" |
| 310 |
#include "examples/example_null/main.cpp" |
| 311 |
|
| 312 |
EOF |
| 313 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 314 |
|
| 315 |
- name: Build example_null (with IMGUI_DISABLE_OBSOLETE_KEYIO) |
| 316 |
run: | |
| 317 |
cat > example_single_file.cpp <<'EOF' |
| 318 |
|
| 319 |
#define IMGUI_DISABLE_OBSOLETE_KEYIO |
| 320 |
#define IMGUI_IMPLEMENTATION |
| 321 |
#include "misc/single_file/imgui_single_file.h" |
| 322 |
#include "examples/example_null/main.cpp" |
| 323 |
|
| 324 |
EOF |
| 325 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 326 |
|
| 327 |
- name: Build example_null (with C++20) |
| 328 |
run: | |
| 329 |
cat > example_single_file.cpp <<'EOF' |
| 330 |
|
| 331 |
#define IMGUI_DISABLE_OBSOLETE_KEYIO |
| 332 |
#define IMGUI_IMPLEMENTATION |
| 333 |
#include "misc/single_file/imgui_single_file.h" |
| 334 |
#include "examples/example_null/main.cpp" |
| 335 |
|
| 336 |
EOF |
| 337 |
g++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 338 |
|
| 339 |
- name: Build example_null (with IMGUI_DISABLE_DEMO_WINDOWS and IMGUI_DISABLE_DEBUG_TOOLS) |
| 340 |
run: | |
| 341 |
cat > example_single_file.cpp <<'EOF' |
| 342 |
|
| 343 |
#define IMGUI_DISABLE_DEMO_WINDOWS |
| 344 |
#define IMGUI_DISABLE_DEBUG_TOOLS |
| 345 |
#define IMGUI_IMPLEMENTATION |
| 346 |
#include "misc/single_file/imgui_single_file.h" |
| 347 |
#include "examples/example_null/main.cpp" |
| 348 |
|
| 349 |
EOF |
| 350 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 351 |
|
| 352 |
- name: Build example_null (with IMGUI_DISABLE_FILE_FUNCTIONS) |
| 353 |
run: | |
| 354 |
cat > example_single_file.cpp <<'EOF' |
| 355 |
|
| 356 |
#define IMGUI_DISABLE_FILE_FUNCTIONS |
| 357 |
#define IMGUI_IMPLEMENTATION |
| 358 |
#include "misc/single_file/imgui_single_file.h" |
| 359 |
#include "examples/example_null/main.cpp" |
| 360 |
|
| 361 |
EOF |
| 362 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 363 |
|
| 364 |
- name: Build example_null (with IMGUI_USE_BGRA_PACKED_COLOR) |
| 365 |
run: | |
| 366 |
cat > example_single_file.cpp <<'EOF' |
| 367 |
|
| 368 |
#define IMGUI_USE_BGRA_PACKED_COLOR |
| 369 |
#define IMGUI_IMPLEMENTATION |
| 370 |
#include "misc/single_file/imgui_single_file.h" |
| 371 |
#include "examples/example_null/main.cpp" |
| 372 |
|
| 373 |
EOF |
| 374 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 375 |
|
| 376 |
- name: Build example_null (with IM_VEC2_CLASS_EXTRA and IM_VEC4_CLASS_EXTRA) |
| 377 |
run: | |
| 378 |
cat > example_single_file.cpp <<'EOF' |
| 379 |
|
| 380 |
struct MyVec2 { float x; float y; MyVec2(float x, float y) : x(x), y(y) { } }; |
| 381 |
struct MyVec4 { float x; float y; float z; float w; |
| 382 |
MyVec4(float x, float y, float z, float w) : x(x), y(y), z(z), w(w) { } }; |
| 383 |
#define IM_VEC2_CLASS_EXTRA \ |
| 384 |
ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ |
| 385 |
operator MyVec2() const { return MyVec2(x, y); } |
| 386 |
#define IM_VEC4_CLASS_EXTRA \ |
| 387 |
ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ |
| 388 |
operator MyVec4() const { return MyVec4(x, y, z, w); } |
| 389 |
#define IMGUI_IMPLEMENTATION |
| 390 |
#include "misc/single_file/imgui_single_file.h" |
| 391 |
#include "examples/example_null/main.cpp" |
| 392 |
|
| 393 |
EOF |
| 394 |
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 395 |
|
| 396 |
- name: Build example_null (C++26, Clang) |
| 397 |
run: | |
| 398 |
cat > example_single_file.cpp <<'EOF' |
| 399 |
|
| 400 |
#define IMGUI_IMPLEMENTATION |
| 401 |
#define IMGUI_DISABLE_DEMO_WINDOWS |
| 402 |
#include "misc/single_file/imgui_single_file.h" |
| 403 |
#include "examples/example_null/main.cpp" |
| 404 |
|
| 405 |
EOF |
| 406 |
clang++ -I. -std=c++26 -Wall -Wformat -fno-exceptions -fno-threadsafe-statics -lc -lm -o example_single_file example_single_file.cpp |
| 407 |
|
| 408 |
- name: Build example_null (without c++ runtime, Clang) |
| 409 |
run: | |
| 410 |
cat > example_single_file.cpp <<'EOF' |
| 411 |
|
| 412 |
#define IMGUI_IMPLEMENTATION |
| 413 |
#define IMGUI_DISABLE_DEMO_WINDOWS |
| 414 |
#include "misc/single_file/imgui_single_file.h" |
| 415 |
#include "examples/example_null/main.cpp" |
| 416 |
|
| 417 |
EOF |
| 418 |
clang++ -I. -std=c++11 -Wall -Wformat -nodefaultlibs -fno-rtti -fno-exceptions -fno-threadsafe-statics -lc -lm -o example_single_file example_single_file.cpp |
| 419 |
|
| 420 |
- name: Build example_glfw_opengl2 |
| 421 |
run: make -C examples/example_glfw_opengl2 |
| 422 |
|
| 423 |
- name: Build example_glfw_opengl3 |
| 424 |
run: make -C examples/example_glfw_opengl3 |
| 425 |
if: github.event_name == 'workflow_run' |
| 426 |
|
| 427 |
- name: Build example_sdl2_opengl2 |
| 428 |
run: make -C examples/example_sdl2_opengl2 |
| 429 |
if: github.event_name == 'workflow_run' |
| 430 |
|
| 431 |
- name: Build example_sdl2_opengl3 |
| 432 |
run: make -C examples/example_sdl2_opengl3 |
| 433 |
|
| 434 |
- name: Build with IMGUI_IMPL_VULKAN_NO_PROTOTYPES |
| 435 |
run: g++ -c -I. -std=c++11 -DIMGUI_IMPL_VULKAN_NO_PROTOTYPES=1 backends/imgui_impl_vulkan.cpp |
| 436 |
|
| 437 |
MacOS: |
| 438 |
runs-on: macos-latest |
| 439 |
steps: |
| 440 |
- uses: actions/checkout@v4 |
| 441 |
|
| 442 |
- name: Install Dependencies |
| 443 |
run: | |
| 444 |
brew install glfw3 sdl2 |
| 445 |
|
| 446 |
- name: Build example_null (extra warnings, clang 64-bit) |
| 447 |
run: make -C examples/example_null WITH_EXTRA_WARNINGS=1 |
| 448 |
|
| 449 |
- name: Build example_null (single file build) |
| 450 |
run: | |
| 451 |
cat > example_single_file.cpp <<'EOF' |
| 452 |
|
| 453 |
#define IMGUI_IMPLEMENTATION |
| 454 |
#include "misc/single_file/imgui_single_file.h" |
| 455 |
#include "examples/example_null/main.cpp" |
| 456 |
|
| 457 |
EOF |
| 458 |
clang++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 459 |
|
| 460 |
- name: Build example_null (single file build, c++20) |
| 461 |
run: | |
| 462 |
cat > example_single_file.cpp <<'EOF' |
| 463 |
|
| 464 |
#define IMGUI_IMPLEMENTATION |
| 465 |
#include "misc/single_file/imgui_single_file.h" |
| 466 |
#include "examples/example_null/main.cpp" |
| 467 |
|
| 468 |
EOF |
| 469 |
clang++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp |
| 470 |
|
| 471 |
- name: Build example_null (without c++ runtime) |
| 472 |
run: | |
| 473 |
cat > example_single_file.cpp <<'EOF' |
| 474 |
|
| 475 |
#define IMGUI_IMPLEMENTATION |
| 476 |
#include "misc/single_file/imgui_single_file.h" |
| 477 |
#include "examples/example_null/main.cpp" |
| 478 |
|
| 479 |
EOF |
| 480 |
clang++ -I. -std=c++11 -Wall -Wformat -nodefaultlibs -fno-rtti -fno-exceptions -fno-threadsafe-statics -lc -lm -o example_single_file example_single_file.cpp |
| 481 |
|
| 482 |
- name: Build example_glfw_opengl2 |
| 483 |
run: make -C examples/example_glfw_opengl2 |
| 484 |
|
| 485 |
- name: Build example_glfw_opengl3 |
| 486 |
run: make -C examples/example_glfw_opengl3 |
| 487 |
if: github.event_name == 'workflow_run' |
| 488 |
|
| 489 |
- name: Build example_glfw_metal |
| 490 |
run: make -C examples/example_glfw_metal |
| 491 |
|
| 492 |
- name: Build example_sdl2_metal |
| 493 |
run: make -C examples/example_sdl2_metal |
| 494 |
|
| 495 |
- name: Build example_sdl2_opengl2 |
| 496 |
run: make -C examples/example_sdl2_opengl2 |
| 497 |
if: github.event_name == 'workflow_run' |
| 498 |
|
| 499 |
- name: Build example_sdl2_opengl3 |
| 500 |
run: make -C examples/example_sdl2_opengl3 |
| 501 |
|
| 502 |
- name: Build example_apple_metal |
| 503 |
run: xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_macos |
| 504 |
|
| 505 |
- name: Build example_apple_opengl2 |
| 506 |
run: xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2 |
| 507 |
|
| 508 |
iOS: |
| 509 |
runs-on: macos-latest |
| 510 |
steps: |
| 511 |
- uses: actions/checkout@v4 |
| 512 |
|
| 513 |
- name: Build example_apple_metal |
| 514 |
run: | |
| 515 |
# Code signing is required, but we disable it because it is irrelevant for CI builds. |
| 516 |
xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_ios CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO |
| 517 |
|
| 518 |
Emscripten: |
| 519 |
runs-on: ubuntu-24.04 |
| 520 |
steps: |
| 521 |
- uses: actions/checkout@v4 |
| 522 |
|
| 523 |
- name: Install Dependencies |
| 524 |
run: | |
| 525 |
wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz |
| 526 |
tar -xvf master.tar.gz |
| 527 |
emsdk-master/emsdk update |
| 528 |
emsdk-master/emsdk install latest |
| 529 |
emsdk-master/emsdk activate latest |
| 530 |
sudo apt-get install build-essential |
| 531 |
|
| 532 |
- name: Build example_sdl2_opengl3 with Emscripten |
| 533 |
run: | |
| 534 |
pushd emsdk-master |
| 535 |
source ./emsdk_env.sh |
| 536 |
popd |
| 537 |
make -C examples/example_sdl2_opengl3 -f Makefile.emscripten |
| 538 |
|
| 539 |
# This build compiles example_glfw_wgpu using Makefile.emscripten and Emscripten GLFW built-in implementation (-sUSE_GLFW=3) |
| 540 |
# This ensures 2 things: the make build works, and the GLFW built-in implementation is tested |
| 541 |
- name: Build example_glfw_wgpu with Emscripten/Makefile |
| 542 |
run: | |
| 543 |
pushd emsdk-master |
| 544 |
source ./emsdk_env.sh |
| 545 |
popd |
| 546 |
make -C examples/example_glfw_wgpu -f Makefile.emscripten |
| 547 |
|
| 548 |
# This build compiles example_glfw_wgpu using CMakeLists.txt and Emscripten GLFW contrib port (--use-port=contrib.glfw3) |
| 549 |
# This ensures 2 things: the CMake build works, and the GLFW contrib port is tested |
| 550 |
- name: Build example_glfw_wgpu with Emscripten/CMake |
| 551 |
run: | |
| 552 |
pushd emsdk-master |
| 553 |
source ./emsdk_env.sh |
| 554 |
popd |
| 555 |
emcc -v |
| 556 |
emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release examples/example_glfw_wgpu |
| 557 |
cmake --build build |
| 558 |
|
| 559 |
Android: |
| 560 |
runs-on: ubuntu-24.04 |
| 561 |
steps: |
| 562 |
- uses: actions/checkout@v4 |
| 563 |
|
| 564 |
- name: Build example_android_opengl3 |
| 565 |
run: | |
| 566 |
cd examples/example_android_opengl3/android |
| 567 |
gradle assembleDebug --stacktrace |