We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4765

Summary: CMAKE: disable SDL_RENDER produces unresolved symbols
Product: SDL Reporter: Martin Gerhardy <martin.gerhardy>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sylvain.becker
Version: 2.0.10   
Hardware: x86_64   
OS: Linux   

Description Martin Gerhardy 2019-08-15 19:36:07 UTC
Maybe more locations - but at least these produce problems for me:
SDL_dynapi_procs.h
SDL_video.c

cmake -DSDL_RENDER=OFF
Comment 1 Sylvain 2019-08-21 10:34:50 UTC
just tried you command, to compile/link/run and it seems to work fine ...
(maybe pthread as to be added manually ...)
Comment 2 Martin Gerhardy 2019-08-21 14:02:05 UTC
Thanks for your feedback. Retries a clean build on my side and it looks like I somehow skipped the render/ dir in the source files.

I thought that it would reduce the code size of the library when I disable a subsystem. But unfortunately it does not. As all functions are included and compiled - in this case you just can never use it as you can't create a renderer.

Wouldn't it be better to guard the function bodies with the macro check, too?

If you agree on this, I could propose a patch. If you don't, then please just ignore this comment.
Comment 3 Sylvain 2019-08-21 15:09:23 UTC
I think disabling the renderer should compiled it out and reduce the library size.

But this should be already existing because many files start with the instruction: "#if !SDL_RENDER_DISABLED" 

so maybe the cmake file has an issue !?
Comment 4 Sylvain 2019-10-23 09:16:02 UTC
As tested, this is working to me. 
Please re-opening if you have still the issue!