build: Fix glfw linking

This commit is contained in:
WerWolv 2023-12-21 16:02:28 +01:00
parent adcaad791a
commit e84b8cb96d
1 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,11 @@ find_package(OpenGL REQUIRED)
find_package(Freetype REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
# pkgsearch somehow reports the glfw3 library as glfw3dll in Release builds on MinGW which is not correct
if ("${GLFW_LIBRARIES}" MATCHES ".+dll")
set(GLFW_LIBRARIES "glfw3")
endif ()
target_include_directories(imgui_custom PUBLIC ${FREETYPE_INCLUDE_DIRS} ${GLFW_INCLUDE_DIRS} ${OpenGL_INCLUDE_DIRS})
target_link_directories(imgui_custom PUBLIC ${FREETYPE_LIBRARY_DIRS} ${GLFW_LIBRARY_DIRS} ${OpenGL_LIBRARY_DIRS})
target_link_libraries(imgui_custom PUBLIC glfw3 ${OPENGL_LIBRARIES})
target_link_libraries(imgui_custom PUBLIC ${GLFW_LIBRARIES} ${OPENGL_LIBRARIES})