diff --git a/recipes/imgui/recipe.py b/recipes/imgui/recipe.py index 767f9f5..df7950b 100644 --- a/recipes/imgui/recipe.py +++ b/recipes/imgui/recipe.py @@ -30,15 +30,22 @@ def _git_cook(env: Environment, repo: dict, options: dict) -> dict: for backend in chain(env.get('IMGUI_BACKENDS', []), options.get('backends', [])): imgui_source_files.append(os.path.join(repo['checkout_root'], 'backends', f'imgui_impl_{backend}.cpp')) + private_cppdefines = ['IMGUI_IMPL_VULKAN_NO_PROTOTYPES=1'] + public_cppdefines = [] + if options.get('user_config'): + define = f'IMGUI_USER_CONFIG=\\"{options["user_config"]}\\"' + private_cppdefines.append(define) + public_cppdefines.append(define) lib_imgui = env.StaticLibrary( CPPPATH = [repo['checkout_root']], - CPPDEFINES = ['IMGUI_IMPL_VULKAN_NO_PROTOTYPES=1'], + CPPDEFINES = private_cppdefines, target = env['LIB_DIR'] + '/imgui', source = imgui_source_files, dependencies = _dependencies(env, None, options) ) return { - 'CPPPATH': [repo['checkout_root']], + 'CPPDEFINES': public_cppdefines, + 'CPPPATH': [repo['checkout_root'], os.path.join(repo['checkout_root'], 'misc/cpp')], 'LIBS': [lib_imgui] }