Skip to content

Commit

Permalink
Tools: Delete imgui FEXConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonicadvance1 committed Sep 13, 2024
1 parent 0a35029 commit 10ee8fd
Show file tree
Hide file tree
Showing 18 changed files with 283 additions and 1,355 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
[submodule "External/cpp-optparse"]
path = Source/Common/cpp-optparse
url = https://github.com/Sonicadvance1/cpp-optparse
[submodule "External/imgui"]
path = External/imgui
url = https://github.com/Sonicadvance1/imgui.git
[submodule "External/xbyak"]
shallow = true
path = External/xbyak
Expand Down
7 changes: 1 addition & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CHECK_INCLUDE_FILES ("gdb/jit-reader.h" HAVE_GDB_JIT_READER_H)
option(BUILD_TESTS "Build unit tests to ensure sanity" TRUE)
option(BUILD_FEX_LINUX_TESTS "Build FEXLinuxTests, requires x86 compiler" FALSE)
option(BUILD_THUNKS "Build thunks" FALSE)
set(USE_FEXCONFIG_TOOLKIT "imgui" CACHE STRING "If set, build FEXConfig (qt or imgui)")
option(BUILD_FEXCONFIG "Build FEXConfig" TRUE)
option(ENABLE_CLANG_THUNKS "Build thunks with clang" FALSE)
option(ENABLE_IWYU "Enables include what you use program" FALSE)
option(ENABLE_LTO "Enable LTO with compilation" TRUE)
Expand Down Expand Up @@ -319,11 +319,6 @@ if (NOT fmt_FOUND)
add_subdirectory(External/fmt/)
endif()

if (USE_FEXCONFIG_TOOLKIT STREQUAL "imgui")
add_subdirectory(External/imgui/)
include_directories(External/imgui/)
endif()

add_subdirectory(External/tiny-json/)
include_directories(External/tiny-json/)

Expand Down
1 change: 0 additions & 1 deletion External/imgui
Submodule imgui deleted from 4c986e
6 changes: 2 additions & 4 deletions Source/Tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
add_subdirectory(CommonTools)

if (NOT MINGW_BUILD)
if (USE_FEXCONFIG_TOOLKIT STREQUAL "imgui")
add_subdirectory(FEXConfig/)
elseif (USE_FEXCONFIG_TOOLKIT STREQUAL "qt")
if (BUILD_FEXCONFIG)
find_package(Qt6 COMPONENTS Qml Quick Widgets QUIET)
if (NOT Qt6_FOUND)
find_package(Qt5 COMPONENTS Qml Quick Widgets REQUIRED)
endif()

add_subdirectory(FEXQonfig/)
add_subdirectory(FEXConfig/)
endif()

if (ENABLE_GDB_SYMBOLS)
Expand Down
39 changes: 14 additions & 25 deletions Source/Tools/FEXConfig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
set(NAME FEXConfig)
set(SRCS Main.cpp
${CMAKE_SOURCE_DIR}/External/imgui/examples/imgui_impl_sdl.cpp
${CMAKE_SOURCE_DIR}/External/imgui/examples/imgui_impl_opengl3.cpp)

find_library(EPOXY epoxy REQUIRED)
find_package(SDL2 REQUIRED)

add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_CUSTOM=<epoxy/gl.h>)
add_executable(${NAME} ${SRCS})

target_include_directories(${NAME} PRIVATE ${CMAKE_SOURCE_DIR}/Source/)
target_include_directories(${NAME} PRIVATE ${CMAKE_SOURCE_DIR}/External/imgui/examples/)

# Fix for SDL2 includes under Alpine Linux.
target_include_directories(${NAME} PRIVATE /usr/include/directfb/)

if (TARGET SDL2::SDL2)
target_link_libraries(${NAME} PRIVATE SDL2::SDL2)
set(CMAKE_AUTOMOC ON)

add_executable(FEXConfig)
target_sources(FEXConfig PRIVATE Main.cpp Main.h)
target_include_directories(FEXConfig PRIVATE ${CMAKE_SOURCE_DIR}/Source/)
target_link_libraries(FEXConfig PRIVATE Common)
if (Qt6_FOUND)
qt_add_resources(QT_RESOURCES qml6.qrc)
target_link_libraries(FEXConfig PRIVATE Qt6::Qml Qt6::Quick Qt6::Widgets)
else()
target_include_directories(${NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
target_link_libraries(${NAME} PRIVATE ${SDL2_LIBRARIES})
qt_add_resources(QT_RESOURCES qml5.qrc)
target_link_libraries(FEXConfig PRIVATE Qt5::Qml Qt5::Quick Qt5::Widgets)
endif()

target_link_libraries(${NAME} PRIVATE Common pthread epoxy X11 EGL imgui)
target_sources(FEXConfig PRIVATE ${QT_RESOURCES})

if (CMAKE_BUILD_TYPE MATCHES "RELEASE")
target_link_options(${NAME}
target_link_options(FEXConfig
PRIVATE
"LINKER:--gc-sections"
"LINKER:--strip-all"
"LINKER:--as-needed"
)
endif()

install(TARGETS ${NAME}
install(TARGETS FEXConfig
RUNTIME
DESTINATION bin
COMPONENT runtime)
Loading

0 comments on commit 10ee8fd

Please sign in to comment.