Skip to content

[directx-dxc] set executbale bit dxc utility on Linux #44224

@seanmiddleditch

Description

@seanmiddleditch

Is your feature request related to a problem? Please describe.

The directx-dxc package includes a command-line tool for compiling HLSL shaders, dxc, whose path is provided in the CMake variable DIRECTX_DXC_TOOL after the appropriate find_package call. Unfortunately, this executable does not appear to be executable by default on Linux.

/bin/sh: 1: /home/runner/work/project/project/vcpkg/installed/x64-linux/tools/directx-dxc/dxc: Permission denied

I added the following snippet to my project's CMake scripts to resolve the issue, verifying that the problem is just the missing executable bit.

 if(CMAKE_HOST_LINUX)
     execute_process(COMMAND "chmod" "+x" "${DIRECTX_DXC_TOOL}")
 endif()

Proposed solution

Set the executable bit on the dxc binary during the installation step of the port.

Adding an appropriate FILE_PERMISSIONS option to that command should resolve it, I believe.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

category:port-featureThe issue is with a library, which is requesting new capabilities that didn’t exist

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions