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
If a dependency cannot be found for whatever reason, the current CMake code allows the explicit definition of the compiler / linker flags for a dependency XYZ through the variables TENSOR_XYZ_CXXFLAGS and TENSOR_XYZ_LDFLAGS. Unfortunately, this scheme does not work for two different reasons:
The name of the dependency, Dummy::XYZ, leads to a CMake error. The underlying reason is that an INTERFACE library is created, and these are restricted in their allowed names.
After fixing the first item, the build files cannot be created because the new interface target is not part of an exported set. The background here is that every dependency for an installed target must either be an IMPORTED target, which will lead the installed configuration to search for it via find_package(), or it must be installed, such as tensor and tensor_options. This INTERFACE target falls into the second category.
I would have created a pull request, but I am not entirely sure how to solve this issue. One could create an IMPORTED target, which, however, needs an import location (static or shared library), which makes the definition of these custom dependencies more complex. Alternatively, one could just append the flags to the tensor_options target. This has the drawback that it spreads knowledge of this special target throughout the code base, and the code must be able to work with a non-existing dependency target.
The text was updated successfully, but these errors were encountered:
If a dependency cannot be found for whatever reason, the current CMake code allows the explicit definition of the compiler / linker flags for a dependency XYZ through the variables TENSOR_XYZ_CXXFLAGS and TENSOR_XYZ_LDFLAGS. Unfortunately, this scheme does not work for two different reasons:
I would have created a pull request, but I am not entirely sure how to solve this issue. One could create an IMPORTED target, which, however, needs an import location (static or shared library), which makes the definition of these custom dependencies more complex. Alternatively, one could just append the flags to the tensor_options target. This has the drawback that it spreads knowledge of this special target throughout the code base, and the code must be able to work with a non-existing dependency target.
The text was updated successfully, but these errors were encountered: