Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[angle] copy libEGL.dll #30142

Closed
wh1t3lord opened this issue Mar 12, 2023 · 9 comments
Closed

[angle] copy libEGL.dll #30142

wh1t3lord opened this issue Mar 12, 2023 · 9 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@wh1t3lord
Copy link

For simplicity.

I use glfw and I want to create EGL context. For this I need to use

glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);

But GLFW returns error with description: "EGL: Library not found"

I use in cmake the suggested heuristic for integration

target_link_libraries(${PROJECT_NAME} PUBLIC 
		 unofficial::angle::libEGL
		 unofficial::angle::libANGLE
		 unofficial::angle::libGLESv2
		 unofficial::angle::angle_common)

But it copies only one library from angle it is libGLESv2.dll and there is no libEGL and as the result I can't run my solution successfully.

@FrankXie05
Copy link
Contributor

vcpkg provides the libEGL.lib. Could you please make sure you have added CMAKE_TOOLCHAIN_FILE and the lib exists in vcpkg/packages/angle_x86-windows(x64-windows)/lib locally ?
image

@FrankXie05 FrankXie05 added the requires:more-information This Issue requires more information to solve label Mar 13, 2023
@dg0yt
Copy link
Contributor

dg0yt commented Mar 13, 2023

@FrankXie05 AFAIU it is not a core build issue but an issue with app-local deployment.

@wh1t3lord
Copy link
Author

@FrankXie05 the lib exists, but it doesn't copy all necessary binaries (.dll). CMAKE_TOOLCHAIN_FILE I passed. You can try to reproduce by your own. Or do you want to say that everything works fine?

@FrankXie05
Copy link
Contributor

FrankXie05 commented Mar 13, 2023

@wh1t3lord Could you pleae provide a simple cmake project to reproduce ?
I can't say how well it works. Because I have little information. For example, whether the vcpkg provided is correct, error log, recurrence code, etc. :)
image

@dg0yt I want to make sure that there is no problem with the local provided, and then considering the use of it.

@wh1t3lord
Copy link
Author

wh1t3lord commented Mar 13, 2023

@FrankXie05 maybe I didn't explain the situation correctly.

I set output dir in cmake in order to collect all dlls and exe of my solution.

Many of dependencies that were built as dlls through vcpkg are copied (x64-windows configuration), but angle's libraries are not copied. For that case I said that libEGL.dll is not in my output folder while other libraries are. Is it error on vcpkg side?

I set output dirs like this

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

I have built libEGL.dll the problem is I don't want to manually copy that library to my solution. Somehow other libraries are copying to that dir)))

@xiaozhuai
Copy link
Contributor

xiaozhuai commented Mar 15, 2023

It was because glfw didn't link to libEGL at all. It open libEGL dynamic library on runtime.
You can check your exe dependencies by https://github.com/lucasg/Dependencies, you'll find there is no libEGL.
libGLESv2 is link to your project, so it was copied.

See glfw/glfw#2114 and #29622

@dg0yt
Copy link
Contributor

dg0yt commented Mar 15, 2023

This is what I expected: DLL used as a module/plugin. This is not handled by vcpkg's app-local deployment, except for qt and magnum plugins.

@FrankXie05
Copy link
Contributor

FrankXie05 commented Mar 15, 2023

@xiaozhuai @dg0yt @wh1t3lord
We can go to issue #29622 . I asked whether the upstream supports it If we don't reply in a short time, we will solve it.

Duplicate of #29622

@FrankXie05 FrankXie05 added category:port-bug The issue is with a library, which is something the port should already support and removed requires:more-information This Issue requires more information to solve labels Mar 15, 2023
@xiaozhuai
Copy link
Contributor

xiaozhuai commented Mar 15, 2023

@FrankXie05 #29622 and #30142 are not the same problem.
#29622 already link to libEGL but it crash after angle update to 5414 (after #27444), before that, it work well.
#30142 is a design behavior, by default, glfw didn't link to libEGL, so it wouldn't deploy libEGL.dll.

For #30142, user should mannully copy libEGL.dll or patch glfw to link to angle's libEGL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

4 participants