build.yml 22 KB

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