Skip to content

[cmake] update cmake for PLATFORM_MEMORY#5749

Merged
raysan5 merged 3 commits intoraysan5:masterfrom
CrackedPixel:fix-cmake-platformmemory
Apr 13, 2026
Merged

[cmake] update cmake for PLATFORM_MEMORY#5749
raysan5 merged 3 commits intoraysan5:masterfrom
CrackedPixel:fix-cmake-platformmemory

Conversation

@CrackedPixel
Copy link
Copy Markdown
Contributor

@CrackedPixel CrackedPixel commented Apr 10, 2026

taken from #5731

also tagging cmake maintainers ray mentioned: @Peter0x44 @manuel5975p @JohnnyCena123 (victorHM doesnt appear for me)

How to test:

mkdir build
cd build
cmake .. -DPLATFORM=Memory
make

how to test cross compile (windows for linux users):

mkdir build
cd build
cmake .. -DPLATFORM=Memory -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
make

@Peter0x44
Copy link
Copy Markdown
Contributor

It looks reasonable to me. How do I test it?

@Peter0x44
Copy link
Copy Markdown
Contributor

raylib_opengl_interop.c fails to build with errors like:

C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c: In function 'main':
C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c:100:5: error: unknown type name 'GLuint'
  100 |     GLuint vao = 0;
      |     ^~~~~~
C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c:101:5: error: unknown type name 'GLuint'
  101 |     GLuint vbo = 0;
      |     ^~~~~~
C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c:102:5: error: implicit declaration of function 'glGenVertexArrays' [-Wimplicit-function-declaration]
  102 |     glGenVertexArrays(1, &vao);
      |     ^~~~~~~~~~~~~~~~~
C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c:103:5: error: implicit declaration of function 'glBindVertexArray'; did you mean 'rlLoadVertexArray'? [-Wimplicit-function-declaration]
  103 |     glBindVertexArray(vao);
      |     ^~~~~~~~~~~~~~~~~
      |     rlLoadVertexArray

it should probably be skipped?

Every example also fails to link with a missing symbol from winmm

C:\WINDOWS\system32\cmd.exe /C "cd . && C:\programming\toolchains\w64devkit\bin\cc.exe -std=c11 -fno-strict-aliasing -Werror=implicit-function-declaration -Werror=pointer-arith  examples/CMakeFiles/core_clipboard_text.dir/core/core_clipboard_text.c.obj -o examples\core_clipboard_text.exe -Wl,--out-implib,examples\libcore_clipboard_text.dll.a -Wl,--major-image-version,0,--minor-image-version,0  raylib/libraylib.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/programming/toolchains/w64devkit/bin/ld.exe: raylib/libraylib.a(rcore.c.obj):rcore.c:(.text+0x40b0e): undefined reference to `__imp_timeBeginPeriod'
collect2.exe: error: ld returned 1 exit status

@CrackedPixel
Copy link
Copy Markdown
Contributor Author

raylib_opengl_interop.c fails to build with errors like:

C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c: In function 'main':
C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c:100:5: error: unknown type name 'GLuint'
  100 |     GLuint vao = 0;
      |     ^~~~~~
C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c:101:5: error: unknown type name 'GLuint'
  101 |     GLuint vbo = 0;
      |     ^~~~~~
C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c:102:5: error: implicit declaration of function 'glGenVertexArrays' [-Wimplicit-function-declaration]
  102 |     glGenVertexArrays(1, &vao);
      |     ^~~~~~~~~~~~~~~~~
C:/programming/homedir/raylib/examples/others/raylib_opengl_interop.c:103:5: error: implicit declaration of function 'glBindVertexArray'; did you mean 'rlLoadVertexArray'? [-Wimplicit-function-declaration]
  103 |     glBindVertexArray(vao);
      |     ^~~~~~~~~~~~~~~~~
      |     rlLoadVertexArray

it should probably be skipped?

Every example also fails to link with a missing symbol from winmm

C:\WINDOWS\system32\cmd.exe /C "cd . && C:\programming\toolchains\w64devkit\bin\cc.exe -std=c11 -fno-strict-aliasing -Werror=implicit-function-declaration -Werror=pointer-arith  examples/CMakeFiles/core_clipboard_text.dir/core/core_clipboard_text.c.obj -o examples\core_clipboard_text.exe -Wl,--out-implib,examples\libcore_clipboard_text.dll.a -Wl,--major-image-version,0,--minor-image-version,0  raylib/libraylib.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/programming/toolchains/w64devkit/bin/ld.exe: raylib/libraylib.a(rcore.c.obj):rcore.c:(.text+0x40b0e): undefined reference to `__imp_timeBeginPeriod'
collect2.exe: error: ld returned 1 exit status
  1. updated OP with testing instructions
  2. removed opengl example for memory platform
  3. fixed missing -lwinmm

@Peter0x44
Copy link
Copy Markdown
Contributor

Hmm. the desktop platform should need the winmm link too. I wonder where it comes from there.

I don't have the time to look now, just acknowledging I saw the push.

@raysan5 raysan5 merged commit 034ffda into raysan5:master Apr 13, 2026
17 checks passed
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Apr 13, 2026

@CrackedPixel I'm merging the changes. I'm a bit concerned about WinMM library because it is a raylib requirement on Win32 platform, afaik also GLFW requires it to be explicitly added...

About raylib_opengl_interop, that example should be moved from examples but not sure where to place it, maybe raylib-extras? others folder will be removed at some moment...

@CrackedPixel CrackedPixel deleted the fix-cmake-platformmemory branch April 15, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants