Skip to content

[CMake] Unable to locate lib/DxcSupport/dxcapi.use.cpp when building from a parent project #7708

@sergeiepopov

Description

@sergeiepopov

Description
When I add dxc as a dependency to my project through add_subdirectory("external/dxc"), it now fails to build because this line is unable to correctly locate /lib/DxcSupport/dxcapi.use.cpp due to ${CMAKE_SOURCE_DIR} now pointing to my top-level project path rather than the dxc root path.
The regression was introduced in the #7514

Steps to Reproduce
Create a CMake project and add dxc as a dependency using add_subdirectory("external/dxc").

Actual Behavior

CMake Error at core/external/dxc/cmake/modules/AddLLVM.cmake:611 (add_executable):
Cannot find source file:

C:/source/engine/lib/DxcSupport/dxcapi.use.cpp

Environment

  • DXC version latest master
  • Host Operating System Windows 11

Metadata

Metadata

Assignees

Labels

bugBug, regression, crashneeds-triageAwaiting triage

Type

No type

Projects

Status

Triaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions