bincrafters / community

Central repository for issues and recipes
http://bincrafters.readthedocs.io/en/latest/
MIT License
218 stars 36 forks source link

glfw/3.3.2 Testing: CMake doesn't find X11, breaks Vulkan support #1197

Closed Erlkoenig90 closed 4 years ago

Erlkoenig90 commented 4 years ago

Package and Environment Details

Conan profile

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=8
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

Build Glfw package from Testing/3.3.2 branch by conan create -o glfw:shared=True . myself+conan-glfw/testing --build missing. The output will include something like this:

-- Looking for XOpenDisplay in /home/niklas.guertler/.conan/data/libx11/1.6.8/bincrafters/stable/package/850b375ef3612a164776566c2d1529fc4923366e/lib/libX11.a;/home/niklas.guertler/.conan/data/libxext/1.3.4/bincrafters/stable/package/0d8dd2f619dd6b0b89738f67825b6d13af0f1e3b/lib/libXext.a
-- Looking for XOpenDisplay in /home/niklas.guertler/.conan/data/libx11/1.6.8/bincrafters/stable/package/850b375ef3612a164776566c2d1529fc4923366e/lib/libX11.a;/home/niklas.guertler/.conan/data/libxext/1.3.4/bincrafters/stable/package/0d8dd2f619dd6b0b89738f67825b6d13af0f1e3b/lib/libXext.a - not found

Build an application using this Glfw library and Vulkan which then calls vkGetPhysicalDeviceSurfaceCapabilitiesKHR. This will wrongly return VK_ERROR_INITIALIZATION_FAILED as the surface wasn't created properly by Glfw.

Root cause

The cause for this is the removal of the mesa dependency. The conan-mesa conanfile.py defines the default options 'libxcb:shared': True, 'libx11:shared': True which let CMake find the X11 libraries as shared libraries via FindX11. Without mesa and these default_options, when building glfw, CMake attempts to use the libX11.a static library for finding XOpenDisplay without also linking with libxcb, causing undefined references to said function, which lets CMake assume libX11 doesn't work.

Solution

A solution for this is to copy these default options into conan-glfw's conanfile.py. I will submit a pull request that does this.

ericLemanissier commented 4 years ago

This recipe is now on Conan-Center-Index. Please migrate your issue there. Thanks!