ImGui: Added user_config option for supplying a user-defined configuration file (see IMGUI_USER_CONFIG). Added misc/cpp to include path so imgui_stdlib.h can be easily included.
This commit is contained in:
parent
82185f1a4e
commit
94d960d49c
@ -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', [])):
|
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'))
|
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(
|
lib_imgui = env.StaticLibrary(
|
||||||
CPPPATH = [repo['checkout_root']],
|
CPPPATH = [repo['checkout_root']],
|
||||||
CPPDEFINES = ['IMGUI_IMPL_VULKAN_NO_PROTOTYPES=1'],
|
CPPDEFINES = private_cppdefines,
|
||||||
target = env['LIB_DIR'] + '/imgui',
|
target = env['LIB_DIR'] + '/imgui',
|
||||||
source = imgui_source_files,
|
source = imgui_source_files,
|
||||||
dependencies = _dependencies(env, None, options)
|
dependencies = _dependencies(env, None, options)
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
'CPPPATH': [repo['checkout_root']],
|
'CPPDEFINES': public_cppdefines,
|
||||||
|
'CPPPATH': [repo['checkout_root'], os.path.join(repo['checkout_root'], 'misc/cpp')],
|
||||||
'LIBS': [lib_imgui]
|
'LIBS': [lib_imgui]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user