Add conditional build option for stb-image implementation - #33
Open
magicse wants to merge 1 commit into
Open
Conversation
Added option to conditionally include stb-image implementation in build. To avoide multiple definition of `stbi_load' and e.t.c....
GencoreOperative
approved these changes
Sep 3, 2026
GencoreOperative
left a comment
There was a problem hiding this comment.
I've provided a comment to consider. Thanks for looking into this.
Comment on lines
+26
to
+30
| option(LLAMA_AGENT_NEEDS_STB "Build stb_image implementation locally" OFF) | ||
|
|
||
| if(LLAMA_AGENT_NEEDS_STB) | ||
| list(APPEND AGENT_SOURCES stb-image-impl.cpp) | ||
| endif() |
There was a problem hiding this comment.
An alternative approach is to lean on the CMake provided WIN32 flag which felt like a possible fit as well.
Suggested change
| option(LLAMA_AGENT_NEEDS_STB "Build stb_image implementation locally" OFF) | |
| if(LLAMA_AGENT_NEEDS_STB) | |
| list(APPEND AGENT_SOURCES stb-image-impl.cpp) | |
| endif() | |
| # stb-image-impl.cpp compiles STB_IMAGE_IMPLEMENTATION into the executable. On | |
| # non-Windows static builds these stbi_* symbols are already provided by libmtmd.a | |
| # (pulled in transitively via server-context), so compiling them here causes | |
| # duplicate-definition link errors. Only build it on Windows, where llama-agent | |
| # links against mtmd's shared library and needs its own copy. | |
| if(WIN32) | |
| target_sources(${TARGET} PRIVATE stb-image-impl.cpp) | |
| endif() |
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.
Added option to conditionally include stb-image implementation in build. To avoide multiple definition of `stbi_load' and e.t.c....
Overview
Additional information
Requirements