diff --git a/ports/llgl/CONTROL b/ports/llgl/CONTROL new file mode 100644 index 000000000..476ccd8c2 --- /dev/null +++ b/ports/llgl/CONTROL @@ -0,0 +1,10 @@ +Source: llgl +Version: 2019-08-15 +Homepage: https://github.com/LukasBanana/LLGL +Description: Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal. + +Feature: opengl +Description: Support for opengl + +Feature: direct3d11 +Description: Support for direct3d11 \ No newline at end of file diff --git a/ports/llgl/fix-arm64-build-error.patch b/ports/llgl/fix-arm64-build-error.patch new file mode 100644 index 000000000..d80061c16 --- /dev/null +++ b/ports/llgl/fix-arm64-build-error.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f440884..f1a9190 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -559,6 +559,8 @@ if(APPLE) + endif() + elseif(UNIX) + target_link_libraries(LLGL X11 pthread Xxf86vm Xrandr) ++elseif(WIN32) ++ target_link_libraries(LLGL gdi32 shell32) + endif() + + set_target_properties(LLGL PROPERTIES LINKER_LANGUAGE CXX DEBUG_POSTFIX "D") diff --git a/ports/llgl/fix-install-error.patch b/ports/llgl/fix-install-error.patch new file mode 100644 index 000000000..30b9c3040 --- /dev/null +++ b/ports/llgl/fix-install-error.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f440884..d1b0c2f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -614,6 +614,12 @@ if(LLGL_BUILD_RENDERER_OPENGL) + target_link_libraries(LLGL_OpenGL LLGL ${OPENGL_LIBRARIES}) + + ADD_DEFINE(LLGL_BUILD_RENDERER_OPENGL) ++ ++ install(TARGETS LLGL_OpenGL ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ ) + else() + message("Missing OpenGL -> LLGL_OpenGL renderer will be excluded from project") + endif() +@@ -681,6 +687,12 @@ if(WIN32) + target_link_libraries(LLGL_Direct3D11 LLGL d3d11 dxgi D3DCompiler) + + ADD_DEFINE(LLGL_BUILD_RENDERER_DIRECT3D11) ++ ++ install(TARGETS LLGL_Direct3D11 ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ ) + endif() + + if(LLGL_BUILD_RENDERER_DIRECT3D12) +@@ -821,4 +833,13 @@ if(LLGL_ENABLE_SPIRV_REFLECT) + message("Including Submodule: SPIRV") + endif() + ++# Install targets ++install(TARGETS ${PROJECT_NAME} ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++) ++# Install headers ++install(DIRECTORY ${PROJECT_INCLUDE_DIR} DESTINATION include) ++ + diff --git a/ports/llgl/portfile.cmake b/ports/llgl/portfile.cmake new file mode 100644 index 000000000..c41de8b45 --- /dev/null +++ b/ports/llgl/portfile.cmake @@ -0,0 +1,41 @@ +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(FATAL_ERROR "${PORT} currently doesn't supports UWP.") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO LukasBanana/LLGL + REF 8f28437960ed60622e94f4f97b24e842b5a0e9e6 + SHA512 8a6bd4109e977f9def0f04a3d31f7bd4beebbe162c52eaa08a54daf8335871615215ece166e5a9d5b5475b834fd53a26ff9638ff270a2f00c88bab21ed156760 + HEAD_REF master + PATCHES + fix-install-error.patch + fix-arm64-build-error.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + opengl LLGL_BUILD_RENDERER_OPENGL + direct3d11 LLGL_BUILD_RENDERER_DIRECT3D11 +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +vcpkg_copy_pdbs() + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) \ No newline at end of file