Skip to content

Commit cfe9400

Browse files
xuhdevfacebook-github-bot
authored andcommitted
Remove preprocessing of CFLAGS, CPPFLAGS, and LDFLAGS in Python scripts. (pytorch#23528)
Summary: After pytorch#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: pytorch#23528 Differential Revision: D16561561 Pulled By: ezyang fbshipit-source-id: 962a27a2b0a18db0f95477ad067a2611e4128187
1 parent fd61cc9 commit cfe9400

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

tools/setup_helpers/cmake.py

-7
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ def generate(self, version, cmake_python_library, build_python, build_test, my_e
187187
toolset_expr = ','.join(["{}={}".format(k, v) for k, v in toolset_dict.items()])
188188
args.append('-T' + toolset_expr)
189189

190-
cflags = os.getenv('CFLAGS', "") + " " + os.getenv('CPPFLAGS', "")
191-
ldflags = os.getenv('LDFLAGS', "")
192-
193190
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(
194191
os.path.abspath(__file__))))
195192
install_dir = os.path.join(base_dir, "torch")
@@ -259,10 +256,6 @@ def generate(self, version, cmake_python_library, build_python, build_test, my_e
259256
# Options starting with CMAKE_
260257
cmake__options = {
261258
'CMAKE_INSTALL_PREFIX': install_dir,
262-
'CMAKE_C_FLAGS': cflags,
263-
'CMAKE_CXX_FLAGS': cflags,
264-
'CMAKE_EXE_LINKER_FLAGS': ldflags,
265-
'CMAKE_SHARED_LINKER_FLAGS': ldflags,
266259
}
267260

268261
# We set some CMAKE_* options in our Python build code instead of relying on the user's direct settings. Emit an

0 commit comments

Comments
 (0)