Commit 25bd6f7a authored by Yong Tang's avatar Yong Tang Committed by Martin Wicke
Browse files

Allow tfcompile_flags to be a list (#12769)



* Allow tfcompile_flags to be a list

This fix tries to fix the issue raised in 12767 where
it was not possible to specify tfcompile_flags as a list:
```
tf_library(
  ...
  tfcompile_flags = ["--target_cpu='core-avx2'", "--xla_enable_fast_math=false"]
)
```
will crash upon build with '+' operator applied to incompatible types (select of string, list)

This is inconsistent with other rules like 'copts' in cc_binary.

The issue is from tfcompile.bzl:
```
" " + (tfcompile_flags or "")),
```

This fix uses `" ".join(tfcompile_flags or [])` instead so that it
is possible to specify the list.

This fix fixes 12767.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add support of string for tfcompile_flags

so that backward compatibility could be maintained.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 98dfabf4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment