build.yml 23 KB

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