Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adds freetype compilation unit when toggled - #2799

Open
jUnG3 wants to merge 1 commit into
mesonbuild:masterfrom
jUnG3:imgui-freetype
Open

Adds freetype compilation unit when toggled#2799
jUnG3 wants to merge 1 commit into
mesonbuild:masterfrom
jUnG3:imgui-freetype

Conversation

@jUnG3

@jUnG3 jUnG3 commented Jun 17, 2026

Copy link
Copy Markdown

Adds the misc/freetype/imgui_freetype.cpp compilation unit with its dependencies to the imgui lib when the option freetype is set.

that enables this kind of configuration in your project

dependency('imgui', default_options: ['freetype=true'])

sources += files('misc/freetype/imgui_freetype.cpp')
add_project_arguments('-DIMGUI_ENABLE_FREETYPE', language: 'cpp')
dependencies += dependency('freetype2')
endif

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a features makes more sense than a boolean option here:

Suggested change
endif
freetype_dep = dependency('freetype2', required: get_option('freetype'))
if freetype_dep.found()
sources += files('misc/freetype/imgui_freetype.cpp')
add_project_arguments('-DIMGUI_ENABLE_FREETYPE', language: 'cpp')
dependencies += freetype_dep
endif

Also instead of add_project_arguments create a separate variables for private compile args.

@bgilbert bgilbert added the needs fixes Pull request received review feedback and needs adjustments label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs fixes Pull request received review feedback and needs adjustments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants