Repository navigation
Build for Windows Store (UWP) without app-side workarounds - #1065
Open
Coastrnaut wants to merge 2 commits into
Open
Coastrnaut wants to merge 2 commits into
Coastrnaut wants to merge 2 commits into
Conversation
Configuring libprojectM with CMAKE_SYSTEM_NAME=WindowsStore failed to compile, so apps had to patch the build: - UWP projects enable SDL checks, which turn the CRT deprecation warnings (strdup, stricmp, fopen, sscanf) into errors. Define _CRT_SECURE_NO_WARNINGS and _CRT_NONSTDC_NO_WARNINGS for these builds. - NOMINMAX, WIN32_LEAN_AND_MEAN and STBI_NO_DDS were only defined when the platform is Windows, not WindowsStore. - Desktop OpenGL isn't available to UWP apps, and glad's WGL loader doesn't compile there, so force ENABLE_GLES on, like for Android. - DynamicLibrary_win32.cpp uses LoadLibraryEx, GetModuleHandle and GetSystemDirectory, which UWP apps can't call. Add DynamicLibrary_uwp.cpp, which loads the EGL/GLES provider (e.g. ANGLE) from the app package with LoadPackagedLibrary. - UWP apps have no process environment, so treat all GL resolver environment flags as unset instead of calling getenv. Desktop builds compile the same code as before. Related to projectM-visualizer#1058
Adds a job that configures with CMAKE_SYSTEM_NAME=WindowsStore and builds Debug and Release for x64 and Win32, so changes that break UWP builds are caught here instead of in the Windows Store app. Related to projectM-visualizer#1058
This was referenced Nov 13, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #1058
Configuring libprojectM with
CMAKE_SYSTEM_NAME=WindowsStorecurrently fails to compile, so a UWP app has to patch the build (frontend-uwp#7 does this from its ownCMakeLists.txt). This makes libprojectM build for UWP as is, and adds a CI job so it stays that way.Changes
strdup,stricmp,fopen) and inGLProbe.cpp(sscanf)._CRT_SECURE_NO_WARNINGSand_CRT_NONSTDC_NO_WARNINGSare now defined for WindowsStore builds.NOMINMAX,WIN32_LEAN_AND_MEANandSTBI_NO_DDSwere only defined forPLATFORM_IDWindows; they're now also defined forWindowsStore.ENABLE_GLESis forced on, like for Android.DynamicLibrary_win32.cppusesLoadLibraryEx,GetModuleHandleandGetSystemDirectory, which UWP apps can't call. The newDynamicLibrary_uwp.cpploads the EGL/GLES provider (e.g. ANGLE) from the app package withLoadPackagedLibrary, using the existingkAllEglModuleNameslist.DynamicLibrary_win32.cppis skipped for UWP via aPLATFORM_WINDOWS_STORE_APPmacro based onWINAPI_FAMILY_PARTITION.EnvFlagEnabled()treats all GL resolver flags as unset there.build-uwpjob inbuild_windows.ymlbuilds Debug and Release for x64 and Win32 onwindows-2022with the v142 toolset (the setup frontend-uwp's CI uses).Desktop builds compile the same code as before.
Testing
_APPCRT libraries available to UWP apps (includingLoadPackagedLibrary), noopengl32,LoadLibraryExorGetModuleHandle. I don't have the v142 toolset locally, so the new CI job is its first v142 build.Note for frontend-uwp#7: it compiles its own
DynamicLibrary_uwp.cppin place ofDynamicLibrary_win32.cpp. With this change that would give duplicate symbols, so once its submodule moves past this, it should drop that workaround (the others become unnecessary but don't break anything).Retested on current master (2026-11-12)