提交 cfe94009 编写于 作者: Hong Xu's avatar Hong Xu 提交者: Facebook Github Bot

Remove preprocessing of CFLAGS, CPPFLAGS, and LDFLAGS in Python scripts. (#23528)

Summary:
After https://github.com/pytorch/pytorch/issues/23455, there is no need of this preprocessing in Python scripts.
They will be automatically processed in CMake (plus CPPFLAGS here
probably meant to be CXXFLAGS).

Reference:

- https://cmake.org/cmake/help/v3.15/envvar/CFLAGS.html
- https://cmake.org/cmake/help/v3.15/envvar/CXXFLAGS.html
- https://cmake.org/cmake/help/v3.15/envvar/LDFLAGS.html
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23528

Differential Revision: D16561561

Pulled By: ezyang

fbshipit-source-id: 962a27a2b0a18db0f95477ad067a2611e4128187
上级 fd61cc9e
......@@ -187,9 +187,6 @@ class CMake:
toolset_expr = ','.join(["{}={}".format(k, v) for k, v in toolset_dict.items()])
args.append('-T' + toolset_expr)
cflags = os.getenv('CFLAGS', "") + " " + os.getenv('CPPFLAGS', "")
ldflags = os.getenv('LDFLAGS', "")
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
install_dir = os.path.join(base_dir, "torch")
......@@ -259,10 +256,6 @@ class CMake:
# Options starting with CMAKE_
cmake__options = {
'CMAKE_INSTALL_PREFIX': install_dir,
'CMAKE_C_FLAGS': cflags,
'CMAKE_CXX_FLAGS': cflags,
'CMAKE_EXE_LINKER_FLAGS': ldflags,
'CMAKE_SHARED_LINKER_FLAGS': ldflags,
}
# We set some CMAKE_* options in our Python build code instead of relying on the user's direct settings. Emit an
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册