Git Product home page Git Product logo

Comments (7)

zeux avatar zeux commented on August 16, 2024 1

Works fine for me:

~/Volkmold/build $ cmake -GNinja -DCMAKE_CXX_FLAGS="-fuse-ld=mold" ..
-- The CXX compiler identification is GNU 12.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
 Vulkan as target
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/zeux/Volkmold/build
~/Volkmold/build $ ninja
(0.145) [2/2] Linking CXX executable Volkmold

However, I do see libvulkan.so appended in the command line. This should not happen. I think it's happening because of declared dependency on Vulkan::Vulkan in volk's CMakeLists.txt via target_link_libraries here:

    if(TARGET volk)
      target_link_libraries(volk PUBLIC Vulkan::Vulkan)
    endif()
    target_link_libraries(volk_headers INTERFACE Vulkan::Vulkan)

These are wrong, but I'd need to go back in CMake history to see why they were added / how to best fix it, as we need an include dependency from Vulkan::Vulkan but not the libraries.

from volk.

zeux avatar zeux commented on August 16, 2024 1

Ok yeah this is due to a dependency on Vulkan::Vulkan, which should not be here. What needs to happen is either that we only depend on Vulkan::Headers, or that we grab the include path from Vulkan::Vulkan and manually add it to volk. I have a patch for the latter that seems to work but I need to look at whether we can just rely on Vulkan::Headers as it's simpler.

from volk.

zeux avatar zeux commented on August 16, 2024

You should not be linking libvulkan when using volk.

from volk.

mokafolio avatar mokafolio commented on August 16, 2024

I am not, at least not on purpose. Could it be that SDL pulls in vulkan somehow?

I just checked, the same issue persists when removing SDL from the equation. The only cmake subfolder I go into that calls find_package(Vulkan ...) is volk. I will do some more invastigating, certainly odd.

from volk.

mokafolio avatar mokafolio commented on August 16, 2024

I put a minimal example to reproduce the issue over here: https://github.com/mokafolio/Volkmold. Build using:

mkdir build
cd build
cmake -GNinja -DCMAKE_CXX_FLAGS="-fuse-ld=mold" ..
ninja

from volk.

zeux avatar zeux commented on August 16, 2024

Posted a patch that seems to be the most straightforward way to handle this atm. Vulkan::Headers is new as of CMake 3.21, so for now we need to rely on the variables set by FindVulkan.cmake as I understand it.

from volk.

mokafolio avatar mokafolio commented on August 16, 2024

I just tested your branch and can confirm that it fixes the warnings on mold 2.0. Thanks for the blazingly fast turnaround! Feel free to close the issue once you merge the PR!

from volk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.