Skip to content

Commit

Permalink
[upstream_utils] Add imgui and friends (wpilibsuite#6822)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger authored Jul 21, 2024
1 parent 8548d83 commit 6922b9d
Show file tree
Hide file tree
Showing 157 changed files with 149,208 additions and 165 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pregenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
run: ./wpilibj/generate_hids.py && ./wpilibc/generate_hids.py && ./wpilibNewCommands/generate_hids.py
- name: Run PWM Controllers
run: ./wpilibj/generate_pwm_motor_controllers.py && ./wpilibc/generate_pwm_motor_controllers.py
- name: Run imgui gl3w
run: ./thirdparty/imgui_suite/generate_gl3w.py
- name: Run imgui fonts
run: ./thirdparty/imgui_suite/generate_fonts.sh
- name: Add untracked files to index so they count as changes
run: git add -A
- name: Check output
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/upstream-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,31 @@ jobs:
cd upstream_utils
./gcem.py clone
./gcem.py copy-upstream-to-thirdparty
- name: Run gl3w.py
run: |
cd upstream_utils
./gl3w.py clone
./gl3w.py copy-upstream-to-thirdparty
- name: Run glfw.py
run: |
cd upstream_utils
./glfw.py clone
./glfw.py copy-upstream-to-thirdparty
- name: Run googletest.py
run: |
cd upstream_utils
./googletest.py clone
./googletest.py copy-upstream-to-thirdparty
- name: Run imgui.py
run: |
cd upstream_utils
./imgui.py clone
./imgui.py copy-upstream-to-thirdparty
- name: Run implot.py
run: |
cd upstream_utils
./implot.py clone
./implot.py copy-upstream-to-thirdparty
- name: Run json.py
run: |
cd upstream_utils
Expand Down Expand Up @@ -90,6 +110,11 @@ jobs:
cd upstream_utils
./sleipnir.py clone
./sleipnir.py copy-upstream-to-thirdparty
- name: Run stb.py
run: |
cd upstream_utils
./stb.py clone
./stb.py copy-upstream-to-thirdparty
- name: Add untracked files to index so they count as changes
run: git add -A
- name: Check output
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ endif()

if(WITH_GUI)
add_subdirectory(fieldImages)
add_subdirectory(imgui)
add_subdirectory(thirdparty/imgui_suite)
add_subdirectory(wpigui)
add_subdirectory(glass)
add_subdirectory(outlineviewer)
Expand Down
4 changes: 1 addition & 3 deletions cscore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ nativeUtils.exportsConfigs {
}
}

apply from: "${rootDir}/shared/imgui.gradle"

model {
components {
examplesMap.each { key, value ->
Expand All @@ -200,7 +198,7 @@ model {
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
lib library: 'cscore', linkage: 'shared'
nativeUtils.useRequiredLibrary(it, 'imgui')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
it.buildable = false
return
Expand Down
4 changes: 2 additions & 2 deletions datalogtool/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def wpilibVersionFileInput = file("src/main/generate/WPILibVersion.cpp.in")
def wpilibVersionFileOutput = file("$buildDir/generated/main/cpp/WPILibVersion.cpp")

apply from: "${rootDir}/shared/libssh.gradle"
apply from: "${rootDir}/shared/imgui.gradle"

task generateCppVersion() {
description = 'Generates the wpilib version class'
Expand Down Expand Up @@ -102,7 +101,8 @@ model {
lib project: ':glass', library: 'glass', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
nativeUtils.useRequiredLibrary(it, 'imgui', 'libssh')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
nativeUtils.useRequiredLibrary(it, 'libssh')
if (it.targetPlatform.operatingSystem.isWindows()) {
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
it.linker.args << 'ws2_32.lib' << 'advapi32.lib' << 'crypt32.lib' << 'user32.lib'
Expand Down
8 changes: 3 additions & 5 deletions glass/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ apply from: "${rootDir}/shared/config.gradle"
def wpilibVersionFileInput = file("src/app/generate/WPILibVersion.cpp.in")
def wpilibVersionFileOutput = file("$buildDir/generated/app/cpp/WPILibVersion.cpp")

apply from: "${rootDir}/shared/imgui.gradle"

task generateCppVersion() {
description = 'Generates the wpilib version class'
group = 'WPILib'
Expand Down Expand Up @@ -112,7 +110,7 @@ model {
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
lib project: ':fieldImages', library: 'fieldImages', linkage: 'shared'
nativeUtils.useRequiredLibrary(it, 'imgui')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
}
appendDebugPathToBinaries(binaries)
}
Expand Down Expand Up @@ -142,7 +140,7 @@ model {
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
lib project: ':fieldImages', library: 'fieldImages', linkage: 'shared'
nativeUtils.useRequiredLibrary(it, 'imgui')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
}
appendDebugPathToBinaries(binaries)
}
Expand Down Expand Up @@ -181,7 +179,7 @@ model {
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
nativeUtils.useRequiredLibrary(it, 'opencv_static')
nativeUtils.useRequiredLibrary(it, 'imgui')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
if (it.targetPlatform.operatingSystem.isWindows()) {
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
it.linker.args << '/DELAYLOAD:MF.dll' << '/DELAYLOAD:MFReadWrite.dll' << '/DELAYLOAD:MFPlat.dll' << '/delay:nobind'
Expand Down
8 changes: 0 additions & 8 deletions imgui/.styleguide

This file was deleted.

111 changes: 0 additions & 111 deletions imgui/CMakeLists.txt

This file was deleted.

7 changes: 0 additions & 7 deletions imgui/src/stb_image.cpp

This file was deleted.

4 changes: 1 addition & 3 deletions outlineviewer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ apply from: "${rootDir}/shared/config.gradle"
def wpilibVersionFileInput = file("src/main/generate/WPILibVersion.cpp.in")
def wpilibVersionFileOutput = file("$buildDir/generated/main/cpp/WPILibVersion.cpp")

apply from: "${rootDir}/shared/imgui.gradle"

task generateCppVersion() {
description = 'Generates the wpilib version class'
group = 'WPILib'
Expand Down Expand Up @@ -104,7 +102,7 @@ model {
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
nativeUtils.useRequiredLibrary(it, 'imgui')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
if (it.targetPlatform.operatingSystem.isWindows()) {
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
} else if (it.targetPlatform.operatingSystem.isMacOsX()) {
Expand Down
4 changes: 2 additions & 2 deletions roborioteamnumbersetter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def wpilibVersionFileInput = file("src/main/generate/WPILibVersion.cpp.in")
def wpilibVersionFileOutput = file("$buildDir/generated/main/cpp/WPILibVersion.cpp")

apply from: "${rootDir}/shared/libssh.gradle"
apply from: "${rootDir}/shared/imgui.gradle"

task generateCppVersion() {
description = 'Generates the wpilib version class'
Expand Down Expand Up @@ -103,7 +102,8 @@ model {
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
nativeUtils.useRequiredLibrary(it, 'imgui', 'libssh')
nativeUtils.useRequiredLibrary(it, 'libssh')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
if (it.targetPlatform.operatingSystem.isWindows()) {
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
it.linker.args << 'ws2_32.lib' << 'advapi32.lib' << 'crypt32.lib' << 'user32.lib'
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ include 'processstarter'
include 'epilogue-processor'
include 'epilogue-runtime'
include 'thirdparty:googletest'
include 'thirdparty:imgui_suite'

buildCache {
def cred = {
Expand Down
13 changes: 0 additions & 13 deletions shared/imgui.gradle

This file was deleted.

4 changes: 1 addition & 3 deletions simulation/halsim_gui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ apply from: "${rootDir}/shared/googletest.gradle"
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"


apply from: "${rootDir}/shared/imgui.gradle"

model {
binaries {
all {
Expand All @@ -33,7 +31,7 @@ model {
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
nativeUtils.useRequiredLibrary(it, 'imgui')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
it.buildable = false
return
Expand Down
6 changes: 2 additions & 4 deletions sysid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ apply from: "${rootDir}/shared/config.gradle"
def wpilibVersionFileInput = file("src/main/generate/WPILibVersion.cpp.in")
def wpilibVersionFileOutput = file("$buildDir/generated/main/cpp/WPILibVersion.cpp")

apply from: "${rootDir}/shared/imgui.gradle"

task generateCppVersion() {
description = 'Generates the wpilib version class'
group = 'WPILib'
Expand Down Expand Up @@ -105,7 +103,7 @@ model {
lib project: ':wpimath', library: 'wpimath', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
nativeUtils.useRequiredLibrary(it, 'imgui')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
if (it.targetPlatform.operatingSystem.isWindows()) {
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
it.linker.args << '/DELAYLOAD:MF.dll' << '/DELAYLOAD:MFReadWrite.dll' << '/DELAYLOAD:MFPlat.dll' << '/delay:nobind'
Expand Down Expand Up @@ -147,7 +145,7 @@ model {
lib project: ':wpimath', library: 'wpimath', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
nativeUtils.useRequiredLibrary(it, 'imgui')
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
if (it.targetPlatform.operatingSystem.isWindows()) {
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
it.linker.args << '/DELAYLOAD:MF.dll' << '/DELAYLOAD:MFReadWrite.dll' << '/DELAYLOAD:MFPlat.dll' << '/delay:nobind'
Expand Down
Loading

0 comments on commit 6922b9d

Please sign in to comment.