2019-10-23 23:10:47 +08:00
name : build
2019-10-30 22:10:43 +08:00
on :
2021-01-27 07:45:13 +08:00
push :
pull_request :
2021-02-16 16:33:29 +08:00
workflow_run :
# Use a workflow as a trigger of scheduled builds. Forked repositories can disable scheduled builds by disabling
# "scheduled" workflow, while maintaining ability to perform local CI builds.
workflows :
- scheduled
2024-08-23 20:12:18 +08:00
- manual
2021-02-16 16:33:29 +08:00
branches :
- master
- docking
types :
- requested
2019-10-23 23:10:47 +08:00
jobs :
Windows :
runs-on : windows-2019
env :
2020-01-20 21:57:39 +08:00
VS_PATH : C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
2019-10-23 23:10:47 +08:00
MSBUILD_PATH : C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
steps :
2024-02-01 23:07:29 +08:00
- uses : actions/checkout@v4
2019-10-23 23:10:47 +08:00
2019-10-30 17:30:46 +08:00
- name : Install Dependencies
shell : powershell
run : |
2023-02-07 18:54:50 +08:00
Invoke-WebRequest -Uri "https://www.libsdl.org/release/SDL2-devel-2.26.3-VC.zip" -OutFile "SDL2-devel-2.26.3-VC.zip"
Expand-Archive -Path SDL2-devel-2.26.3-VC.zip
echo "SDL2_DIR=$(pwd)\SDL2-devel-2.26.3-VC\SDL2-2.26.3\" >>${env:GITHUB_ENV}
2021-01-27 07:45:13 +08:00
2019-10-30 17:30:46 +08:00
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
Expand-Archive -Path vulkan-sdk-1.1.121.2.zip
2021-01-27 07:45:13 +08:00
echo "VULKAN_SDK=$(pwd)\vulkan-sdk-1.1.121.2\" >>${env:GITHUB_ENV}
2019-10-30 17:30:46 +08:00
2019-10-23 23:10:47 +08:00
- name : Fix Projects
shell : powershell
run : |
2021-12-13 19:57:33 +08:00
# CI workers do not supporter older Visual Studio versions. Fix projects to target newer available version.
2019-10-23 23:10:47 +08:00
gci -recurse -filter "*.vcxproj" | ForEach-Object {
2021-12-13 19:57:33 +08:00
(Get-Content $_.FullName) -Replace "<PlatformToolset>v\d{3}</PlatformToolset>","<PlatformToolset>v142</PlatformToolset>" | Set-Content -Path $_.FullName
(Get-Content $_.FullName) -Replace "<WindowsTargetPlatformVersion>[\d\.]+</WindowsTargetPlatformVersion>","<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>" | Set-Content -Path $_.FullName
2019-10-23 23:10:47 +08:00
}
2019-10-30 16:45:27 +08:00
# 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.
2020-01-20 21:57:39 +08:00
- name : Build example_null (extra warnings, mingw 64-bit)
2020-03-19 18:10:58 +08:00
run : mingw32-make -C examples/example_null WITH_EXTRA_WARNINGS=1
2019-11-25 20:02:47 +08:00
2021-10-12 23:49:24 +08:00
- name : Build example_null (mingw 64-bit, as DLL)
shell : bash
run : |
echo '#ifdef _EXPORT' > example_single_file.cpp
echo '# define IMGUI_API __declspec(dllexport)' >> example_single_file.cpp
echo '#else' >> example_single_file.cpp
echo '# define IMGUI_API __declspec(dllimport)' >> example_single_file.cpp
echo '#endif' >> example_single_file.cpp
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
g++ -I. -Wall -Wformat -D_EXPORT -shared -o libimgui.dll -Wl,--out-implib,libimgui.a example_single_file.cpp -limm32
g++ -I. -Wall -Wformat -o example_null.exe examples/example_null/main.cpp -L. -limgui
rm -f example_null.exe libimgui.* example_single_file.*
2020-01-20 21:57:39 +08:00
- name : Build example_null (extra warnings, msvc 64-bit)
shell : cmd
run : |
cd examples\example_null
2020-12-02 18:23:56 +08:00
call "%VS_PATH%\VC\Auxiliary\Build\vcvars64.bat"
2020-11-19 04:05:52 +08:00
.\build_win32.bat /W4
2020-01-20 21:57:39 +08:00
2020-01-11 01:36:26 +08:00
- name : Build example_null (single file build)
shell : bash
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2021-02-24 16:26:13 +08:00
g++ -I. -Wall -Wformat -o example_single_file.exe example_single_file.cpp -limm32
2019-11-26 17:24:01 +08:00
2020-04-29 18:32:16 +08:00
- name : Build example_null (with IMGUI_DISABLE_WIN32_FUNCTIONS)
shell : bash
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_DISABLE_WIN32_FUNCTIONS
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2021-02-24 16:26:13 +08:00
g++ -I. -Wall -Wformat -o example_single_file.exe example_single_file.cpp -limm32
2020-04-29 18:32:16 +08:00
- name : Build example_null (as DLL)
shell : cmd
run : |
2020-12-02 18:23:56 +08:00
call "%VS_PATH%\VC\Auxiliary\Build\vcvars64.bat"
2021-01-27 07:45:13 +08:00
2020-11-19 04:05:52 +08:00
echo #ifdef _EXPORT > example_single_file.cpp
echo # define IMGUI_API __declspec(dllexport) >> example_single_file.cpp
echo #else >> example_single_file.cpp
echo # define IMGUI_API __declspec(dllimport) >> example_single_file.cpp
echo #endif >> example_single_file.cpp
echo #define IMGUI_IMPLEMENTATION >> example_single_file.cpp
echo #include "misc/single_file/imgui_single_file.h" >> example_single_file.cpp
2021-01-27 07:45:13 +08:00
2020-04-29 18:32:16 +08:00
cl.exe /D_USRDLL /D_WINDLL /D_EXPORT /I. example_single_file.cpp /LD /FeImGui.dll /link
cl.exe /I. ImGui.lib /Feexample_null.exe examples/example_null/main.cpp
2019-10-30 16:45:27 +08:00
- name : Build Win32 example_glfw_opengl2
2019-10-23 23:10:47 +08:00
shell : cmd
2019-10-30 16:45:27 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj /p:Platform=Win32 /p:Configuration=Release'
2019-10-23 23:10:47 +08:00
2019-10-30 16:45:27 +08:00
- name : Build Win32 example_glfw_opengl3
2019-10-23 23:10:47 +08:00
shell : cmd
2019-10-30 16:45:27 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj /p:Platform=Win32 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
2019-10-30 17:30:46 +08:00
- name : Build Win32 example_glfw_vulkan
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 17:30:46 +08:00
2024-08-07 02:27:23 +08:00
- name : Build Win32 example_sdl2_sdlrenderer2
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj /p:Platform=Win32 /p:Configuration=Release'
if : github.event_name == 'workflow_run'
2023-02-07 18:54:50 +08:00
- name : Build Win32 example_sdl2_vulkan
2019-10-30 17:30:46 +08:00
shell : cmd
2023-02-07 18:54:50 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 17:30:46 +08:00
2023-02-07 18:54:50 +08:00
- name : Build Win32 example_sdl2_opengl2
2019-10-30 17:30:46 +08:00
shell : cmd
2023-02-07 18:54:50 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj /p:Platform=Win32 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 17:30:46 +08:00
2023-02-07 18:54:50 +08:00
- name : Build Win32 example_sdl2_opengl3
2019-10-30 17:30:46 +08:00
shell : cmd
2023-02-07 18:54:50 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj /p:Platform=Win32 /p:Configuration=Release'
2019-10-30 17:30:46 +08:00
2023-02-07 18:54:50 +08:00
- name : Build Win32 example_sdl2_directx11
2019-10-30 17:30:46 +08:00
shell : cmd
2023-02-07 18:54:50 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj /p:Platform=Win32 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 17:30:46 +08:00
2019-10-30 16:45:27 +08:00
- name : Build Win32 example_win32_directx9
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx9/example_win32_directx9.vcxproj /p:Platform=Win32 /p:Configuration=Release'
- name : Build Win32 example_win32_directx10
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx10/example_win32_directx10.vcxproj /p:Platform=Win32 /p:Configuration=Release'
- name : Build Win32 example_win32_directx11
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx11/example_win32_directx11.vcxproj /p:Platform=Win32 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
- name : Build x64 example_glfw_opengl2
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj /p:Platform=x64 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
- name : Build x64 example_glfw_opengl3
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj /p:Platform=x64 /p:Configuration=Release'
2019-10-30 17:30:46 +08:00
- name : Build x64 example_glfw_vulkan
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release'
2024-08-07 02:27:23 +08:00
- name : Build x64 example_sdl2_sdlrenderer2
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj /p:Platform=x64 /p:Configuration=Release'
if : github.event_name == 'workflow_run'
2023-02-07 18:54:50 +08:00
- name : Build x64 example_sdl2_vulkan
2019-10-30 17:30:46 +08:00
shell : cmd
2023-02-07 18:54:50 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 17:30:46 +08:00
2023-02-07 18:54:50 +08:00
- name : Build x64 example_sdl2_opengl2
2019-10-30 17:30:46 +08:00
shell : cmd
2023-02-07 18:54:50 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj /p:Platform=x64 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 17:30:46 +08:00
2023-02-07 18:54:50 +08:00
- name : Build x64 example_sdl2_opengl3
2019-10-30 17:30:46 +08:00
shell : cmd
2023-02-07 18:54:50 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj /p:Platform=x64 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 17:30:46 +08:00
2023-02-07 18:54:50 +08:00
- name : Build x64 example_sdl2_directx11
2019-10-30 17:30:46 +08:00
shell : cmd
2023-02-07 18:54:50 +08:00
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj /p:Platform=x64 /p:Configuration=Release'
2019-10-30 17:30:46 +08:00
2019-10-30 16:45:27 +08:00
- name : Build x64 example_win32_directx9
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx9/example_win32_directx9.vcxproj /p:Platform=x64 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
- name : Build x64 example_win32_directx10
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx10/example_win32_directx10.vcxproj /p:Platform=x64 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
- name : Build x64 example_win32_directx11
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx11/example_win32_directx11.vcxproj /p:Platform=x64 /p:Configuration=Release'
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
- name : Build x64 example_win32_directx12
shell : cmd
run : '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release'
2019-10-23 23:10:47 +08:00
Linux :
2024-09-05 21:15:49 +08:00
runs-on : ubuntu-24.04
2019-10-23 23:10:47 +08:00
steps :
2024-02-01 23:07:29 +08:00
- uses : actions/checkout@v4
2019-10-23 23:10:47 +08:00
- name : Install Dependencies
run : |
sudo apt-get update
2021-05-25 21:36:03 +08:00
sudo apt-get install -y libglfw3-dev libsdl2-dev gcc-multilib g++-multilib libfreetype6-dev libvulkan-dev
2019-10-23 23:10:47 +08:00
2019-11-26 18:17:58 +08:00
- name : Build example_null (extra warnings, gcc 32-bit)
run : |
make -C examples/example_null clean
2020-03-19 18:10:58 +08:00
CXXFLAGS="$CXXFLAGS -m32 -Werror" make -C examples/example_null WITH_EXTRA_WARNINGS=1
2019-11-26 18:17:58 +08:00
- name : Build example_null (extra warnings, gcc 64-bit)
run : |
make -C examples/example_null clean
2020-03-19 18:10:58 +08:00
CXXFLAGS="$CXXFLAGS -m64 -Werror" make -C examples/example_null WITH_EXTRA_WARNINGS=1
2019-11-26 18:17:58 +08:00
- name : Build example_null (extra warnings, clang 32-bit)
run : |
make -C examples/example_null clean
2020-03-19 18:10:58 +08:00
CXXFLAGS="$CXXFLAGS -m32 -Werror" CXX=clang++ make -C examples/example_null WITH_EXTRA_WARNINGS=1
2019-11-26 18:17:58 +08:00
- name : Build example_null (extra warnings, clang 64-bit)
run : |
make -C examples/example_null clean
2020-03-19 18:10:58 +08:00
CXXFLAGS="$CXXFLAGS -m64 -Werror" CXX=clang++ make -C examples/example_null WITH_EXTRA_WARNINGS=1
2019-10-30 16:45:27 +08:00
2021-08-27 21:06:59 +08:00
- name : Build example_null (extra warnings, empty IM_ASSERT)
run : |
cat > example_single_file.cpp <<'EOF'
#define IM_ASSERT(x)
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
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
2021-08-27 21:06:59 +08:00
2020-03-18 15:26:51 +08:00
- name : Build example_null (freetype)
run : |
make -C examples/example_null clean
make -C examples/example_null WITH_FREETYPE=1
2020-01-11 01:36:26 +08:00
- name : Build example_null (single file build)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2020-03-04 00:45:06 +08:00
- name : Build example_null (with ImWchar32)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_USE_WCHAR32
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2019-11-26 17:24:01 +08:00
2021-04-26 16:18:18 +08:00
- name : Build example_null (with large ImDrawIdx + pointer ImTextureID)
2020-03-16 16:04:36 +08:00
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
2021-04-26 16:18:18 +08:00
#define ImTextureID void*
2021-01-27 07:45:13 +08:00
#define ImDrawIdx unsigned int
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2020-03-16 16:04:36 +08:00
- name : Build example_null (with IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2020-03-16 16:04:36 +08:00
2022-01-04 03:52:52 +08:00
- name : Build example_null (with IMGUI_DISABLE_OBSOLETE_KEYIO)
run : |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_DISABLE_OBSOLETE_KEYIO
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2022-01-04 03:52:52 +08:00
2024-09-05 21:28:41 +08:00
- name : Build example_null (with C++20)
2024-09-05 21:19:04 +08:00
run : |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_DISABLE_OBSOLETE_KEYIO
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2024-09-05 21:28:41 +08:00
g++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp
2024-09-05 21:19:04 +08:00
2022-06-15 21:58:26 +08:00
- name : Build example_null (with IMGUI_DISABLE_DEMO_WINDOWS and IMGUI_DISABLE_DEBUG_TOOLS)
2020-03-16 16:04:36 +08:00
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_DISABLE_DEMO_WINDOWS
2022-06-15 21:58:26 +08:00
#define IMGUI_DISABLE_DEBUG_TOOLS
2021-01-27 07:45:13 +08:00
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2020-03-16 16:04:36 +08:00
2020-04-29 18:32:16 +08:00
- name : Build example_null (with IMGUI_DISABLE_FILE_FUNCTIONS)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_DISABLE_FILE_FUNCTIONS
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2020-04-29 18:32:16 +08:00
- name : Build example_null (with IMGUI_USE_BGRA_PACKED_COLOR)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_USE_BGRA_PACKED_COLOR
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2020-04-29 18:32:16 +08:00
- name : Build example_null (with IM_VEC2_CLASS_EXTRA and IM_VEC4_CLASS_EXTRA)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
struct MyVec2 { float x; float y; MyVec2(float x, float y) : x(x), y(y) { } };
struct MyVec4 { float x; float y; float z; float w;
MyVec4(float x, float y, float z, float w) : x(x), y(y), z(z), w(w) { } };
#define IM_VEC2_CLASS_EXTRA \
ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \
operator MyVec2() const { return MyVec2(x, y); }
#define IM_VEC4_CLASS_EXTRA \
ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \
operator MyVec4() const { return MyVec4(x, y, z, w); }
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2020-04-29 18:32:16 +08:00
2024-09-05 21:30:29 +08:00
- name : Build example_null (C++26, Clang)
run : |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#define IMGUI_DISABLE_DEMO_WINDOWS
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
clang++ -I. -std=c++26 -Wall -Wformat -fno-exceptions -fno-threadsafe-statics -lc -lm -o example_single_file example_single_file.cpp
2020-05-25 18:25:22 +08:00
- name : Build example_null (without c++ runtime, Clang)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#define IMGUI_DISABLE_DEMO_WINDOWS
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
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
2020-05-25 18:25:22 +08:00
2019-10-30 16:45:27 +08:00
- name : Build example_glfw_opengl2
run : make -C examples/example_glfw_opengl2
- name : Build example_glfw_opengl3
run : make -C examples/example_glfw_opengl3
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
2023-02-07 18:54:50 +08:00
- name : Build example_sdl2_opengl2
run : make -C examples/example_sdl2_opengl2
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
2023-02-07 18:54:50 +08:00
- name : Build example_sdl2_opengl3
run : make -C examples/example_sdl2_opengl3
2019-10-23 23:10:47 +08:00
2021-05-25 21:36:03 +08:00
- name : Build with IMGUI_IMPL_VULKAN_NO_PROTOTYPES
2022-02-16 00:06:50 +08:00
run : g++ -c -I. -std=c++11 -DIMGUI_IMPL_VULKAN_NO_PROTOTYPES=1 backends/imgui_impl_vulkan.cpp
2021-05-25 21:36:03 +08:00
2019-10-23 23:10:47 +08:00
MacOS :
2021-02-16 16:33:29 +08:00
runs-on : macos-latest
2019-10-23 23:10:47 +08:00
steps :
2024-02-01 23:07:29 +08:00
- uses : actions/checkout@v4
2019-10-23 23:10:47 +08:00
- name : Install Dependencies
run : |
2021-01-27 07:45:13 +08:00
brew install glfw3 sdl2
2019-10-23 23:10:47 +08:00
2020-01-20 21:57:39 +08:00
- name : Build example_null (extra warnings, clang 64-bit)
2020-03-19 18:10:58 +08:00
run : make -C examples/example_null WITH_EXTRA_WARNINGS=1
2019-10-30 16:45:27 +08:00
2020-01-11 01:36:26 +08:00
- name : Build example_null (single file build)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
clang++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
2019-11-26 17:24:01 +08:00
2024-09-05 21:19:04 +08:00
- name : Build example_null (single file build, c++20)
2024-09-05 21:15:49 +08:00
run : |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2024-09-05 21:19:04 +08:00
clang++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp
2024-09-05 21:15:49 +08:00
2020-05-25 18:25:22 +08:00
- name : Build example_null (without c++ runtime)
run : |
2021-01-27 07:45:13 +08:00
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
2022-02-16 00:06:50 +08:00
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
2020-05-25 18:25:22 +08:00
2019-10-30 16:45:27 +08:00
- name : Build example_glfw_opengl2
run : make -C examples/example_glfw_opengl2
- name : Build example_glfw_opengl3
run : make -C examples/example_glfw_opengl3
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
- name : Build example_glfw_metal
run : make -C examples/example_glfw_metal
2023-02-07 18:54:50 +08:00
- name : Build example_sdl2_metal
run : make -C examples/example_sdl2_metal
2020-02-10 22:13:29 +08:00
2023-02-07 18:54:50 +08:00
- name : Build example_sdl2_opengl2
run : make -C examples/example_sdl2_opengl2
2021-02-16 16:33:29 +08:00
if : github.event_name == 'workflow_run'
2019-10-30 16:45:27 +08:00
2023-02-07 18:54:50 +08:00
- name : Build example_sdl2_opengl3
run : make -C examples/example_sdl2_opengl3
2019-10-30 16:45:27 +08:00
- name : Build example_apple_metal
run : xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_macos
- name : Build example_apple_opengl2
run : xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2
2019-10-23 23:10:47 +08:00
iOS :
2021-02-16 16:33:29 +08:00
runs-on : macos-latest
2019-10-23 23:10:47 +08:00
steps :
2024-02-01 23:07:29 +08:00
- uses : actions/checkout@v4
2019-10-23 23:10:47 +08:00
2019-10-30 16:45:27 +08:00
- name : Build example_apple_metal
2019-10-23 23:10:47 +08:00
run : |
# Code signing is required, but we disable it because it is irrelevant for CI builds.
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
Emscripten :
2024-09-05 21:15:49 +08:00
runs-on : ubuntu-24.04
2019-10-23 23:10:47 +08:00
steps :
2024-02-01 23:07:29 +08:00
- uses : actions/checkout@v4
2019-10-23 23:10:47 +08:00
- name : Install Dependencies
run : |
2019-11-04 15:50:50 +08:00
wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
tar -xvf master.tar.gz
emsdk-master/emsdk update
2023-07-13 18:46:40 +08:00
emsdk-master/emsdk install latest
emsdk-master/emsdk activate latest
2024-09-08 01:23:20 +08:00
sudo apt-get install build-essential
2019-10-23 23:10:47 +08:00
2023-02-07 18:54:50 +08:00
- name : Build example_sdl2_opengl3 with Emscripten
2019-10-23 23:10:47 +08:00
run : |
2020-07-07 17:49:25 +08:00
pushd emsdk-master
source ./emsdk_env.sh
popd
2023-02-07 18:54:50 +08:00
make -C examples/example_sdl2_opengl3 -f Makefile.emscripten
2020-09-28 17:29:54 +08:00
2024-09-08 01:23:20 +08:00
# This build compiles example_glfw_wgpu using Makefile.emscripten and Emscripten GLFW built-in implementation (-sUSE_GLFW=3)
# This ensures 2 things: the make build works, and the GLFW built-in implementation is tested
- name : Build example_glfw_wgpu with Emscripten/Makefile
2021-01-28 18:37:34 +08:00
run : |
pushd emsdk-master
source ./emsdk_env.sh
popd
2024-04-16 19:51:03 +08:00
make -C examples/example_glfw_wgpu -f Makefile.emscripten
2021-01-28 18:37:34 +08:00
2024-09-08 01:23:20 +08:00
# This build compiles example_glfw_wgpu using CMakeLists.txt and Emscripten GLFW contrib port (--use-port=contrib.glfw3)
# This ensures 2 things: the CMake build works, and the GLFW contrib port is tested
- name : Build example_glfw_wgpu with Emscripten/CMake
run : |
pushd emsdk-master
source ./emsdk_env.sh
popd
emcc -v
emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release examples/example_glfw_wgpu
cmake --build build
2021-03-04 17:35:44 +08:00
Android :
2024-09-05 21:15:49 +08:00
runs-on : ubuntu-24.04
2021-03-04 17:35:44 +08:00
steps :
2024-02-01 23:07:29 +08:00
- uses : actions/checkout@v4
2021-03-04 17:35:44 +08:00
- name : Build example_android_opengl3
run : |
cd examples/example_android_opengl3/android
2023-03-07 14:17:56 +08:00
gradle assembleDebug --stacktrace