Fix cmake-built libraylib.a to properly include GLFW's object files (#3598)

I broke this in PR #3573 by accidentally removing too much
The examples still compiled fine so I didn't notice - my guess is that
cmake was still adding a separate link to glfw manually.
This commit is contained in:
Peter0x44 2023-12-03 18:53:11 +00:00 committed by GitHub
parent dfb0ca43c5
commit 8ae804ff9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
set(GLFW_USE_WAYLAND ${USE_WAYLAND} CACHE BOOL "" FORCE) set(GLFW_USE_WAYLAND ${USE_WAYLAND} CACHE BOOL "" FORCE)
set(GLFW_LIBRARY_TYPE "STATIC" CACHE STRING "" FORCE) set(GLFW_LIBRARY_TYPE "OBJECT" CACHE STRING "" FORCE)
add_subdirectory(external/glfw) add_subdirectory(external/glfw)
@ -27,6 +27,7 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT
set_property(TARGET glfw PROPERTY C_VISIBILITY_PRESET hidden) set_property(TARGET glfw PROPERTY C_VISIBILITY_PRESET hidden)
endif() endif()
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw>)
include_directories(BEFORE SYSTEM external/glfw/include) include_directories(BEFORE SYSTEM external/glfw/include)
elseif("${PLATFORM}" STREQUAL "DRM") elseif("${PLATFORM}" STREQUAL "DRM")
MESSAGE(STATUS "No GLFW required on PLATFORM_DRM") MESSAGE(STATUS "No GLFW required on PLATFORM_DRM")