py-torch: ensure libtorch_global_deps is linked with the c++ library (#21860)

* py-torch: ensure libtorch_global_deps is linked with the c++ library

* add comment with upstream issue
This commit is contained in:
Andrew W Elble 2021-02-22 14:02:10 -05:00 committed by GitHub
parent 04a8e59872
commit 08054ffce7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,6 +186,13 @@ def headers(self):
headers.directories = [root] headers.directories = [root]
return headers return headers
@when('@1.5.0:')
def patch(self):
# https://github.com/pytorch/pytorch/issues/52208
filter_file('torch_global_deps PROPERTIES LINKER_LANGUAGE C',
'torch_global_deps PROPERTIES LINKER_LANGUAGE CXX',
'caffe2/CMakeLists.txt')
def setup_build_environment(self, env): def setup_build_environment(self, env):
def enable_or_disable(variant, keyword='USE', var=None, newer=False): def enable_or_disable(variant, keyword='USE', var=None, newer=False):
"""Set environment variable to enable or disable support for a """Set environment variable to enable or disable support for a