[imgui] Add test-engine feature (#38758)

Add test-engine feature to the imgui port:
https://github.com/ocornut/imgui_test_engine

I made it a feature because they both depend on each other to build,
that's why it is a feature instead of a new port.

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] SHA512s are updated for each updated download.
- [ ] ~~The "supports" clause reflects platforms that may be fixed by
this new version.~~
- [ ] ~~Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.~~
- [ ] ~~Any patches that are no longer applied are deleted from the
port's directory.~~
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.
This commit is contained in:
Rémy Tassoux 2024-05-29 10:40:48 +02:00 коммит произвёл GitHub
Родитель 26254b9a59
Коммит 935b5c81c2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
8 изменённых файлов: 105 добавлений и 14 удалений

Просмотреть файл

@ -13,7 +13,7 @@ add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(
${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/test-engine>"
$<INSTALL_INTERFACE:include>
)
@ -126,6 +126,23 @@ if(IMGUI_USE_WCHAR32)
target_compile_definitions(${PROJECT_NAME} PUBLIC IMGUI_USE_WCHAR32)
endif()
if(IMGUI_TEST_ENGINE)
find_package(Stb REQUIRED)
target_include_directories(${PROJECT_NAME} PRIVATE ${Stb_INCLUDE_DIR})
target_sources(
${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_capture_tool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_context.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_coroutine.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_engine.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_exporters.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_perftool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_ui.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_utils.cpp
)
endif()
list(REMOVE_DUPLICATES BINDINGS_SOURCES)
install(
@ -231,6 +248,24 @@ if(NOT IMGUI_SKIP_HEADERS)
if(IMGUI_FREETYPE)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype/imgui_freetype.h DESTINATION include)
endif()
if(IMGUI_TEST_ENGINE)
install(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_capture_tool.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_context.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_coroutine.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_engine.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_exporters.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_imconfig.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_internal.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_perftool.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_ui.h
${CMAKE_CURRENT_SOURCE_DIR}/test-engine/imgui_te_utils.h
DESTINATION
include
)
endif()
endif()
include(CMakePackageConfigHelpers)

Просмотреть файл

@ -34,4 +34,8 @@ if (@IMGUI_BUILD_ALLEGRO5_BINDING@)
find_dependency(Allegro CONFIG)
endif()
if (@IMGUI_TEST_ENGINE@)
find_dependency(Stb)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/imgui-targets.cmake")

Просмотреть файл

@ -2,19 +2,19 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if ("docking-experimental" IN_LIST FEATURES)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF "v${VERSION}-docking"
SHA512 f4e97f8a191276b1deb1510cb9136ab7a9a4abc029727f752dff8c01bb6af4a692b2239de84839aa39aa359220f08ffe9bdff01b57942dd6e01183ec6778cfa7
HEAD_REF docking
)
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF "v${VERSION}-docking"
SHA512 f4e97f8a191276b1deb1510cb9136ab7a9a4abc029727f752dff8c01bb6af4a692b2239de84839aa39aa359220f08ffe9bdff01b57942dd6e01183ec6778cfa7
HEAD_REF docking
)
else()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF "v${VERSION}"
SHA512 c9ff56ec6f8eb05b5034bb0b886568e843743a4313e36613db214f6080506703d5ed2ee606c88cd8957e73575e2b0e39deb52e1ac0c1a6e0a9fe38bca5e6dc0e
HEAD_REF master
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF "v${VERSION}"
SHA512 c9ff56ec6f8eb05b5034bb0b886568e843743a4313e36613db214f6080506703d5ed2ee606c88cd8957e73575e2b0e39deb52e1ac0c1a6e0a9fe38bca5e6dc0e
HEAD_REF master
)
endif()
@ -42,6 +42,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
freetype IMGUI_FREETYPE
freetype-lunasvg IMGUI_FREETYPE_LUNASVG
wchar32 IMGUI_USE_WCHAR32
test-engine IMGUI_TEST_ENGINE
)
if ("libigl-imgui" IN_LIST FEATURES)
@ -57,6 +58,23 @@ if ("libigl-imgui" IN_LIST FEATURES)
file(INSTALL "${IMGUI_FONTS_DROID_SANS_H}" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
endif()
if ("test-engine" IN_LIST FEATURES)
vcpkg_from_github(
OUT_SOURCE_PATH TEST_ENGINE_SOURCE_PATH
REPO ocornut/imgui_test_engine
REF "v${VERSION}"
SHA512 809b06076fbeb544cd9544020c336f943f05bc5772df183c94dbdd5057d9b7b8718c72e5b908205cbef06c511b01f7a8e706a23aa668ca9fd12e891ef8ffb48e
HEAD_REF master
)
file(REMOVE_RECURSE "${SOURCE_PATH}/test-engine")
file(COPY "${TEST_ENGINE_SOURCE_PATH}/imgui_test_engine/" DESTINATION "${SOURCE_PATH}/test-engine")
file(REMOVE_RECURSE "${SOURCE_PATH}/test-engine/thirdparty/stb")
vcpkg_replace_string("${SOURCE_PATH}/test-engine/imgui_capture_tool.cpp" "//#define IMGUI_STB_IMAGE_WRITE_FILENAME \"my_folder/stb_image_write.h\"" "#define IMGUI_STB_IMAGE_WRITE_FILENAME <stb_image_write.h>\n#define STB_IMAGE_WRITE_STATIC")
vcpkg_replace_string("${SOURCE_PATH}/imconfig.h" "#pragma once" "#pragma once\n\n#include \"imgui_te_imconfig.h\"")
vcpkg_replace_string("${SOURCE_PATH}/test-engine/imgui_te_imconfig.h" "#define IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL 0" "#define IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL 1")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
@ -80,4 +98,8 @@ endif()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
if ("test-engine" IN_LIST FEATURES)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt" "${SOURCE_PATH}/test-engine/LICENSE.txt")
else()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
endif()

Просмотреть файл

@ -1,6 +1,7 @@
{
"name": "imgui",
"version": "1.90.6",
"port-version": 1,
"description": "Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies.",
"homepage": "https://github.com/ocornut/imgui",
"license": "MIT",
@ -107,6 +108,14 @@
"sdl2"
]
},
"test-engine": {
"description": "Build test engine",
"supports": "!uwp",
"license": null,
"dependencies": [
"stb"
]
},
"vulkan-binding": {
"description": "Make available Vulkan binding",
"dependencies": [

Просмотреть файл

@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

Просмотреть файл

@ -0,0 +1,15 @@
{
"name": "vcpkg-ci-imgui",
"version-date": "2024-05-17",
"description": "Force test-engine feature of imgui within vcpkg CI",
"homepage": "https://github.com/microsoft/vcpkg",
"license": "MIT",
"dependencies": [
{
"name": "imgui",
"features": [
"test-engine"
]
}
]
}

Просмотреть файл

@ -3602,7 +3602,7 @@
},
"imgui": {
"baseline": "1.90.6",
"port-version": 0
"port-version": 1
},
"imgui-node-editor": {
"baseline": "0.9.3",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "af958fee35b0e48dd0397a6f807e28a3f7bb99ce",
"version": "1.90.6",
"port-version": 1
},
{
"git-tree": "3c5ccb0267846fbcf5153a375c6e05c65ad3c7ab",
"version": "1.90.6",