Skip to content

Commit 79e14f8

Browse files
kkolur76pytorchmergebot
authored andcommitted
[better_engineering][multiplatform] Repalce host_info() check with select for default_compiler_flags (pytorch#98306)
Summary: Same as title Test Plan: CI Differential Revision: D44667769 Pull Request resolved: pytorch#98306 Approved by: https://github.com/priyaramani, https://github.com/malfet
1 parent 390c51b commit 79e14f8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

defs.bzl

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ default_compiler_flags = [
4343
# nvrtc library which we load canonically anyway
4444
"-DUSE_DIRECT_NVRTC",
4545
"-DUSE_RUY_QMATMUL",
46-
] + ([] if native.host_info().os.is_windows else [
46+
] + select({
4747
# XNNPACK depends on an updated version of pthreadpool interface, whose implementation
4848
# includes <pthread.h> - a header not available on Windows.
49-
"-DUSE_XNNPACK",
50-
]) + (["-O1"] if native.read_config("fbcode", "build_mode_test_label", "") == "dev-nosan" else [])
49+
"DEFAULT": ["-DUSE_XNNPACK"],
50+
"ovr_config//os:windows": [],
51+
}) + (["-O1"] if native.read_config("fbcode", "build_mode_test_label", "") == "dev-nosan" else [])
5152

5253
compiler_specific_flags = {
5354
"clang": [

0 commit comments

Comments
 (0)