Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.90.8 and backend shenanigans #122

Merged
merged 11 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
name: Loading only - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1.9'
- '1'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
Expand All @@ -28,17 +28,13 @@ jobs:
exclude:
- os: macOS-latest
arch: x86
- os: ubuntu-latest # covered in "tests" job
arch: x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- run: |
julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path="LibCImGui.jl"))'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/[email protected]
Expand All @@ -49,30 +45,29 @@ jobs:
name: Tests - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1.9'
- '1'
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
# For some reason GLFW won't let us create a window on 32 bit ubuntu
# - x86
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- run: |
julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path="LibCImGui.jl"))'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
prefix: xvfb-run -a -s '-screen 0 1024x768x24'
env:
LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
- uses: julia-actions/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -82,11 +77,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install xvfb && Xvfb :99 &
- uses: julia-actions/setup-julia@v2
- uses: julia-actions/cache@v2
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ imgui_log.txt
.vscode
*Manifest.toml
build
cimgui-pack/test_engine/ImGuiTestEngine
cimgui-pack/test_engine/*-report.txt
cimgui-pack/test_engine/config.toml
cimgui-pack/test_engine/src/overrides.h
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "cimnodes"]
path = cimgui-pack/cimnodes
url = https://github.com/cimgui/cimnodes.git
[submodule "cimgui-pack/test_engine/imgui_test_engine"]
path = cimgui-pack/test_engine/imgui_test_engine
url = https://github.com/ocornut/imgui_test_engine.git
21 changes: 0 additions & 21 deletions LibCImGui.jl/LICENSE

This file was deleted.

19 changes: 0 additions & 19 deletions LibCImGui.jl/Project.toml

This file was deleted.

36 changes: 0 additions & 36 deletions LibCImGui.jl/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions LibCImGui.jl/gen/generator.jl

This file was deleted.

6 changes: 0 additions & 6 deletions LibCImGui.jl/test/runtests.jl

This file was deleted.

23 changes: 11 additions & 12 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
name = "CImGui"
uuid = "5d785b6c-b76f-510e-a07c-3070796c7e87"
authors = ["Yupei Qi <[email protected]>"]
version = "1.89.1"
version = "2.0.0"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
CImGuiPack_jll = "333409e9-af72-5310-9767-d6ad21a76a05"
CSyntax = "ea656a56-6ca6-5dda-bba5-7b6963a5f74c"
ImGuiGLFWBackend = "623d79b3-9695-4e60-bd7e-2a5aabaa6933"
ImGuiOpenGL2Backend = "c105bd9b-9289-4129-acf4-4c081b46d160"
ImGuiOpenGLBackend = "9d0819b4-44e7-43a2-ad03-8fb999128168"
LibCImGui = "9be01004-c4f5-478b-abeb-cb32b114cf5e"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"

[weakdeps]
GLFW = "f7f18e0c-5ee9-5ccd-a5bf-e8befd85ed98"
ModernGL = "66fc600b-dfda-50eb-8b99-91cfa97b1301"

[extensions]
GlfwOpenGLBackend = ["GLFW", "ModernGL"]

[compat]
CEnum = "0.4, 0.5"
CImGuiPack_jll = "0.3.0"
CSyntax = "0.4"
ImGuiGLFWBackend = "0.2"
ImGuiOpenGL2Backend = "0.1"
ImGuiOpenGLBackend = "0.2"
LibCImGui = "~1.89"
Preferences = "1"
julia = "1.6"
julia = "1.9"

[extras]
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Expand Down
93 changes: 88 additions & 5 deletions cimgui-pack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,110 @@ set(target cimgui)

add_library(${target} SHARED)

# cimgui and the backends
target_sources(${target} PRIVATE ./cimgui/imgui/imgui.cpp)
target_sources(${target} PRIVATE ./cimgui/imgui/imgui_demo.cpp)
target_sources(${target} PRIVATE ./cimgui/imgui/imgui_draw.cpp)
target_sources(${target} PRIVATE ./cimgui/imgui/imgui_tables.cpp)
target_sources(${target} PRIVATE ./cimgui/imgui/imgui_widgets.cpp)
target_sources(${target} PRIVATE ./cimgui/imgui/backends/imgui_impl_glfw.cpp)
target_sources(${target} PRIVATE ./cimgui/imgui/backends/imgui_impl_opengl3.cpp)
target_sources(${target} PRIVATE ./cimgui/cimgui.cpp)

# imgui_test_engine
set(TE_DIR "test_engine/imgui_test_engine/imgui_test_engine")
set(WRAPPER_DIR "test_engine/src")
target_sources(${target} PRIVATE
# Wrapper sources
${WRAPPER_DIR}/JlGlobals.cxx
${WRAPPER_DIR}/JlImBuildInfo.cxx
${WRAPPER_DIR}/JlImGuiCaptureArgs.cxx
${WRAPPER_DIR}/JlImGuiCaptureContext.cxx
${WRAPPER_DIR}/JlImGuiCaptureToolUI.cxx
${WRAPPER_DIR}/JlImGuiContext.cxx
${WRAPPER_DIR}/JlImGuiCsvParser.cxx
${WRAPPER_DIR}/JlImGuiPerfTool.cxx
${WRAPPER_DIR}/JlImGuiPerfToolBatch.cxx
${WRAPPER_DIR}/JlImGuiPerfToolEntry.cxx
${WRAPPER_DIR}/JlImGuiTest.cxx
${WRAPPER_DIR}/JlImGuiTestActionFilter.cxx
${WRAPPER_DIR}/JlImGuiTestContext.cxx
${WRAPPER_DIR}/JlImGuiTestCoroutineInterface.cxx
${WRAPPER_DIR}/JlImGuiTestEngine.cxx
${WRAPPER_DIR}/JlImGuiTestEngineIO.cxx
${WRAPPER_DIR}/JlImGuiTestFindByLabelTask.cxx
${WRAPPER_DIR}/JlImGuiTestGatherTask.cxx
${WRAPPER_DIR}/JlImGuiTestGenericItemStatus.cxx
${WRAPPER_DIR}/JlImGuiTestGenericVars.cxx
${WRAPPER_DIR}/JlImGuiTestInfoTask.cxx
${WRAPPER_DIR}/JlImGuiTestInput.cxx
${WRAPPER_DIR}/JlImGuiTestInputs.cxx
${WRAPPER_DIR}/JlImGuiTestItemInfo.cxx
${WRAPPER_DIR}/JlImGuiTestItemList.cxx
${WRAPPER_DIR}/JlImGuiTestLog.cxx
${WRAPPER_DIR}/JlImGuiTestLogLineInfo.cxx
${WRAPPER_DIR}/JlImGuiTestOutput.cxx
${WRAPPER_DIR}/JlImGuiTestRef.cxx
${WRAPPER_DIR}/JlImGuiTestRefDesc.cxx
${WRAPPER_DIR}/JlImGuiTestRunTask.cxx
${WRAPPER_DIR}/JlImMovingAverage.cxx
${WRAPPER_DIR}/JlImVec2.cxx
${WRAPPER_DIR}/JlImVec4.cxx
${WRAPPER_DIR}/JlStr.cxx
${WRAPPER_DIR}/jlImGuiTestEngine.cxx

# Test engine sources
${TE_DIR}/imgui_te_context.cpp
${TE_DIR}/imgui_te_coroutine.cpp
${TE_DIR}/imgui_te_engine.cpp
${TE_DIR}/imgui_te_perftool.cpp
${TE_DIR}/imgui_te_ui.cpp
${TE_DIR}/imgui_te_utils.cpp
${TE_DIR}/imgui_capture_tool.cpp
${TE_DIR}/imgui_te_exporters.cpp
)

# cimplot
target_sources(${target} PRIVATE ./cimplot/implot/implot.cpp)
target_sources(${target} PRIVATE ./cimplot/implot/implot_items.cpp)
target_sources(${target} PRIVATE ./cimplot/implot/implot_demo.cpp)
target_sources(${target} PRIVATE ./cimplot/cimplot.cpp)

# cimnodes
target_sources(${target} PRIVATE ./cimnodes/imnodes/imnodes.cpp)
target_sources(${target} PRIVATE ./cimnodes/cimnodes.cpp)

add_definitions(-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1 -DIMNODES_NAMESPACE=imnodes -DIMGUI_ENABLE_TEST_ENGINE)
target_compile_definitions(${target} PRIVATE
IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1
IMNODES_NAMESPACE=imnodes
IMGUI_ENABLE_TEST_ENGINE
IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=0)

# Find GLFW
if (NOT DEFINED GLFW_LIBRARY)
find_package(glfw3 3.1 REQUIRED)
set(GLFW_LIBRARY "glfw")
endif()
target_link_libraries(${target} "${GLFW_LIBRARY}")

if (WIN32)
add_definitions("-DIMGUI_IMPL_API=extern \"C\" __declspec\(dllexport\)")
target_link_libraries(${target} imm32)
add_definitions("-DIMGUI_IMPL_API=extern \"C\" __declspec\(dllexport\)")
target_link_libraries(${target} imm32 opengl32)
elseif(APPLE)
add_definitions("-DIMGUI_IMPL_API=extern \"C\" ")
target_link_libraries(${target} "-framework OpenGL")
else()
add_definitions("-DIMGUI_IMPL_API=extern \"C\" ")
endif(WIN32)
add_definitions("-DIMGUI_IMPL_API=extern \"C\" ")
target_link_libraries(${target} GL)
endif()

# Linking for cxxwrap
find_package(JlCxx)
get_target_property(JlCxx_location JlCxx::cxxwrap_julia LOCATION)
get_filename_component(JlCxx_location ${JlCxx_location} DIRECTORY)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${JlCxx_location}")
message(STATUS "Found JlCxx at ${JlCxx_location}")
target_link_libraries(${target} JlCxx::cxxwrap_julia)

target_include_directories(${target} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cimgui>
Expand All @@ -39,6 +120,7 @@ target_include_directories(${target} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cimplot/implot>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cimnodes>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cimnodes/imnodes>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/test_engine/imgui_test_engine/imgui_test_engine>
$<INSTALL_INTERFACE:include>)

target_compile_features(${target} PRIVATE cxx_std_11)
Expand All @@ -49,6 +131,7 @@ set(hdrs ${CMAKE_CURRENT_SOURCE_DIR}/cimgui/imgui/imgui.h
${CMAKE_CURRENT_SOURCE_DIR}/cimgui/imgui/imstb_rectpack.h
${CMAKE_CURRENT_SOURCE_DIR}/cimgui/imgui/imstb_textedit.h
${CMAKE_CURRENT_SOURCE_DIR}/cimgui/imgui/imstb_truetype.h
${CMAKE_CURRENT_SOURCE_DIR}/cimgui/generator/output/cimgui_impl.h
${CMAKE_CURRENT_SOURCE_DIR}/cimgui/cimgui.h
${CMAKE_CURRENT_SOURCE_DIR}/cimplot/implot/implot.h
${CMAKE_CURRENT_SOURCE_DIR}/cimplot/implot/implot_internal.h
Expand Down
4 changes: 4 additions & 0 deletions cimgui-pack/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
GLFW_jll = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
WrapIt = "962878d8-9763-11ee-8c14-fbf60c98afae"
6 changes: 6 additions & 0 deletions cimgui-pack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ The versions have been picked so that they're all compatible with each other,
i.e. matching the latest ImGui version. The currently supported ImGui version
is: [*v1.90.8*](https://github.com/ocornut/imgui/releases/tag/v1.90.8).

You can build the resulting shared library locally with:
```julia-repl
# $ julia --project=.
julia> include("cimgui-pack/build.jl")
```

This repo is used directly by:
- [CImGuiPack](https://github.com/JuliaPackaging/Yggdrasil/tree/master/C/CImGuiPack)
to create a JLL.
Expand Down
Loading
Loading