You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FindDirectShaderCompilerDxc.cmake.Mac script is relying on a call to ly_add_target_files to copy the dxc-3.7 exectuable and libdxcompiler.3.7.dylib to the inside of the AssetProcessor.app bundle.
The issue however is that the libdxcompiler.3.7.dylib gets needs to be copied into the AssetProcessor.app/Contents/Framework directory, but does not because of the ly_add_target_files call which specifies a subdirectory of Builders/DirectXShaderCompiler/lib.
This causes the CMake fixup_bundle command to fail when trying to fixup hthe dxc-3.7 executable.
The proper fix is to have the dxc-3.7 executable be associated with add_executable target type that is IMPORTED and the libdxcompiler.3.7.dylib to be associated with an add_library target type of IMPORTED SHARED.
Here is how the logic should look
set(MY_NAME "DirectXShaderCompilerDxc")
set(TARGET_WITH_NAMESPACE "3rdParty::${MY_NAME}")
if (TARGET${TARGET_WITH_NAMESPACE})
return()
endif()
set(${MY_NAME}_BINARY_DIR ${CMAKE_CURRENT_LIST_DIR}/${MY_NAME}/bin)
set(${MY_NAME}_LIB_DIR ${CMAKE_CURRENT_LIST_DIR}/${MY_NAME}/lib)
add_library(${TARGET_WITH_NAMESPACE}INTERFACEIMPORTEDGLOBAL)
# Add an EXECUTABLE IMPORTED target for the dxc applicationadd_executable(${TARGET_WITH_NAMESPACE}::dxc IMPORTEDGLOBAL)
# Set the IMPORTED target to use the dxc-3.7 has for the output fileset_property(TARGET${TARGET_WITH_NAMESPACE}::dxc PROPERTY
IMPORTED_LOCATION ${${MY_NAME}_BINARY_DIR}/dxc-3.7)
# Use ly_add_target_files to additionally copy symlinks whenever the EXECUTABLE target is used
ly_add_target_files(TARGETS ${TARGET_WITH_NAMESPACE}::dxc FILES ${${MY_NAME}_BINARY_DIR}/dxc)
# Add a STATIC IMPORTED target for the dxcompiler libraryadd_library(${TARGET_WITH_NAMESPACE}::dxcompiler SHARED IMPORTEDGLOBAL)
# Set the IMPORTED target to use the libdxcompiler-3.7 shared library for the output fileset_property(TARGET${TARGET_WITH_NAMESPACE}::dxcompiler PROPERTY
IMPORTED_LOCATION ${${MY_NAME}_LIB_DIR}/libdxcompiler.3.7.dylib)
# Use ly_add_target_files to additionally copy the libdxcompiler.dylib symlink next to the SHARED target
ly_add_target_files(TARGETS ${TARGET_WITH_NAMESPACE}::dxcompiler FILES ${${MY_NAME}_LIB_DIR}/libdxcompiler.dylib)
# Update the aggregate ${TARGET_WITH_NAMESPACE} INTERFACE target to depend on both the EXECUTABLE and SHARED library targettarget_link_libraries(${TARGET_WITH_NAMESPACE}PUBLIC${TARGET_WITH_NAMESPACE}::dxc
${TARGET_WITH_NAMESPACE}::dxcompiler)
set(${MY_NAME}_FOUND True)
The text was updated successfully, but these errors were encountered:
The FindDirectShaderCompilerDxc.cmake.Mac script is relying on a call to ly_add_target_files to copy the
dxc-3.7
exectuable andlibdxcompiler.3.7.dylib
to the inside of the AssetProcessor.app bundle.The issue however is that the
libdxcompiler.3.7.dylib
gets needs to be copied into theAssetProcessor.app/Contents/Framework
directory, but does not because of the ly_add_target_files call which specifies a subdirectory ofBuilders/DirectXShaderCompiler/lib
.This causes the CMake fixup_bundle command to fail when trying to fixup hthe
dxc-3.7
executable.The proper fix is to have the
dxc-3.7
executable be associated withadd_executable
target type that is IMPORTED and thelibdxcompiler.3.7.dylib
to be associated with anadd_library
target type of IMPORTED SHARED.Here is how the logic should look
The text was updated successfully, but these errors were encountered: