build: Cleanup opengl and glfw linking

This commit is contained in:
WerWolv 2023-01-24 14:59:19 +01:00
parent 32ed2c30c0
commit 90d9c91717
3 changed files with 5 additions and 13 deletions

View File

@ -8,10 +8,6 @@ find_package(Freetype REQUIRED)
find_package(OpenGL REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
if (UNIX)
find_package(OpenGL REQUIRED)
endif ()
add_library(imgui OBJECT
source/imgui.cpp
source/imgui_demo.cpp
@ -39,12 +35,8 @@ add_library(imgui OBJECT
add_compile_definitions(IMGUI_IMPL_OPENGL_LOADER_GLAD)
target_include_directories(imgui PUBLIC include ${FREETYPE_INCLUDE_DIRS} ${GLFW_INCLUDE_DIRS})
target_include_directories(imgui PUBLIC include ${FREETYPE_INCLUDE_DIRS} ${GLFW_INCLUDE_DIRS} ${OpenGL_INCLUDE_DIRS})
target_link_directories(imgui PUBLIC ${GLFW_LIBRARY_DIRS})
target_link_directories(imgui PUBLIC ${GLFW_LIBRARY_DIRS} ${OpenGL_LIBRARY_DIRS})
if (WIN32)
target_link_libraries(imgui PUBLIC Freetype::Freetype glfw3 opengl32.lib)
elseif (UNIX)
target_link_libraries(imgui PUBLIC Freetype::Freetype glfw OpenGL::GL)
endif()
target_link_libraries(imgui PUBLIC Freetype::Freetype ${GLFW_LIBRARIES} ${OPENGL_LIBRARIES})

View File

@ -72,4 +72,4 @@ elseif (APPLE)
endif ()
target_link_libraries(libimhex PRIVATE ${FMT_LIBRARIES})
target_link_libraries(libimhex PUBLIC dl imgui ${NFD_LIBRARIES} magic ${CAPSTONE_LIBRARIES} LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${LIBBACKTRACE_LIBRARIES} libpl intervaltree)
target_link_libraries(libimhex PUBLIC dl imgui ${NFD_LIBRARIES} magic ${CAPSTONE_LIBRARIES} LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${LIBBACKTRACE_LIBRARIES} libpl intervaltree ${OpenAL_LIBRARIES})

View File

@ -227,7 +227,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addFooterItem([] {
auto taskCount = TaskManager::getRunningTaskCount();
if (taskCount > 0) {
auto &tasks = TaskManager::getRunningTasks();
const auto &tasks = TaskManager::getRunningTasks();
auto frontTask = tasks.front();
auto progress = frontTask->getMaxValue() == 0 ? 1 : float(frontTask->getValue()) / frontTask->getMaxValue();