diff --git a/cmake/vcpkg_ports/glad/CMakeLists.txt b/cmake/vcpkg_ports/glad/CMakeLists.txt index b47003aee5..0ef293b551 100644 --- a/cmake/vcpkg_ports/glad/CMakeLists.txt +++ b/cmake/vcpkg_ports/glad/CMakeLists.txt @@ -10,7 +10,7 @@ set(source_files set(header_files include/glad/gl.h include/glad/vulkan.h - include/KHR/khrplatform.h + #include/KHR/khrplatform.h include/vk_platform.h) if (UNIX) @@ -21,11 +21,15 @@ elseif (WIN32) list(APPEND header_files "include/glad/wgl.h") endif () +# See note in portfile.cmake on external khrplatform.h +find_path(KHRPLATFORM_INCLUDE_DIR "KHR/khrplatform.h") + add_library(${PROJECT_NAME} STATIC ${source_files} ${header_files}) target_include_directories(${PROJECT_NAME} PUBLIC $ + $ $) target_link_libraries(${PROJECT_NAME} PUBLIC ${CMAKE_DL_LIBS}) diff --git a/cmake/vcpkg_ports/glad/portfile.cmake b/cmake/vcpkg_ports/glad/portfile.cmake index f064cba8b5..602a9eae71 100644 --- a/cmake/vcpkg_ports/glad/portfile.cmake +++ b/cmake/vcpkg_ports/glad/portfile.cmake @@ -17,6 +17,10 @@ vcpkg_extract_source_archive( NO_REMOVE_ONE_LEVEL ) +# include/KHR/khrplatform.h conflicts with the `egl-registry` port. Both install the same file. +# To workaround the conflict we remove the glad internal khrplatform.h here and explicitly depend on `egl-registry`. +file(REMOVE_RECURSE "${GLAD_DIR}/include/KHR") + file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${GLAD_DIR}") vcpkg_cmake_configure(SOURCE_PATH ${GLAD_DIR}) diff --git a/cmake/vcpkg_ports/glad/vcpkg.json b/cmake/vcpkg_ports/glad/vcpkg.json index 44333ae1a5..e22f566348 100644 --- a/cmake/vcpkg_ports/glad/vcpkg.json +++ b/cmake/vcpkg_ports/glad/vcpkg.json @@ -5,6 +5,7 @@ "homepage": "https://github.com/Dav1dde/glad", "license": "MIT", "dependencies": [ + "egl-registry", { "name": "vcpkg-cmake", "host": true