CMake search for QT6 messes with finding Vulkan::Headers #94

Closed
opened 2024-03-30 14:58:00 +01:00 by lvella · 1 comment
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Affected Commit or Release

ba3539c517

Description of Issue

If I run CMake like this:

cmake .. -G Ninja -DSUYU_TESTS=off -DSUYU_USE_EXTERNAL_SDL2=off -DENABLE_QT6=on -DSUYU_USE_PRECOMPILED_HEADERS=off

configuration fails with this error:

CMake Error at externals/Vulkan-Headers/CMakeLists.txt:42 (add_library):
  add_library cannot create ALIAS target "Vulkan::Headers" because another
  target with the same name already exists.

Turns out QT6 finds my system installed Vulkan headers and sets the CMake target "Vulkan::Headers" ahead of externals/Vulkan-Headers/CMakeLists.txt.

I can't work around it by setting -DSUYU_USE_EXTERNAL_VULKAN_HEADERS=off, because my system installed Vulkan headers are for a version older than required by suyu.

I have opened PR #45 fixing this by moving the search for externals to before the search for QT, but this breaks something else, which breaks CI.

Not sure what is the best approach to fix this.

Expected Behavior

Configuration should work using the external Vulkan headers.

Reproduction Steps

Run

cmake .. -G Ninja -DSUYU_TESTS=off -DSUYU_USE_EXTERNAL_SDL2=off -DENABLE_QT6=on -DSUYU_USE_PRECOMPILED_HEADERS=off

with Qt6 and Vulkan headers installed system wide.

Log File

Attached.

System Configuration

CPU: AMD Ryzen 5 3600 6-Core Processor
GPU/Driver: AMD Radeon RX Vega (RADV VEGA10)
RAM: 16 GB
OS: Ubuntu 23.10

### Is there an existing issue for this? - [x] I have searched the existing issues ### Affected Commit or Release ba3539c5179913fd32f172d4002cb47b775ddb57 ### Description of Issue If I run CMake like this: ``` cmake .. -G Ninja -DSUYU_TESTS=off -DSUYU_USE_EXTERNAL_SDL2=off -DENABLE_QT6=on -DSUYU_USE_PRECOMPILED_HEADERS=off ``` configuration fails with this error: ``` CMake Error at externals/Vulkan-Headers/CMakeLists.txt:42 (add_library): add_library cannot create ALIAS target "Vulkan::Headers" because another target with the same name already exists. ``` Turns out QT6 finds my system installed Vulkan headers and sets the CMake target "Vulkan::Headers" ahead of `externals/Vulkan-Headers/CMakeLists.txt`. I can't work around it by setting `-DSUYU_USE_EXTERNAL_VULKAN_HEADERS=off`, because my system installed Vulkan headers are for a version older than required by suyu. I have opened PR #45 fixing this by moving the search for externals to before the search for QT, but this breaks something else, which breaks CI. Not sure what is the best approach to fix this. ### Expected Behavior Configuration should work using the external Vulkan headers. ### Reproduction Steps Run ``` cmake .. -G Ninja -DSUYU_TESTS=off -DSUYU_USE_EXTERNAL_SDL2=off -DENABLE_QT6=on -DSUYU_USE_PRECOMPILED_HEADERS=off ``` with Qt6 and Vulkan headers installed system wide. ### Log File Attached. ### System Configuration CPU: AMD Ryzen 5 3600 6-Core Processor GPU/Driver: AMD Radeon RX Vega (RADV VEGA10) RAM: 16 GB OS: Ubuntu 23.10
15 KiB
lvella added the
bug
label 2024-03-30 14:58:00 +01:00
Owner

!45 has been merged. This has not been tested on Windows nor MacOS so feel free to comment if you (the one reading this) have this issue.

!45 has been merged. This has not been tested on Windows nor MacOS so feel free to comment if **you** (the one reading this) have this issue.
Fijxu closed this issue 2024-03-30 20:10:27 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: suyu/suyu#94
No description provided.