setup.py: use CXX to get compiler for libatomic check
This allows it to work with a prefixed compiler when cross-compiling.
This commit is contained in:
parent
328ca01121
commit
ad36ff39d3
5
setup.py
5
setup.py
|
|
@ -166,7 +166,8 @@ def check_linker_need_libatomic():
|
|||
"""Test if linker on system needs libatomic."""
|
||||
code_test = (b'#include <atomic>\n' +
|
||||
b'int main() { return std::atomic<int64_t>{}; }')
|
||||
cpp_test = subprocess.Popen(['c++', '-x', 'c++', '-std=c++11', '-'],
|
||||
cxx = os.environ.get('CXX', 'c++')
|
||||
cpp_test = subprocess.Popen([cxx, '-x', 'c++', '-std=c++11', '-'],
|
||||
stdin=PIPE,
|
||||
stdout=PIPE,
|
||||
stderr=PIPE)
|
||||
|
|
@ -176,7 +177,7 @@ def check_linker_need_libatomic():
|
|||
# Double-check to see if -latomic actually can solve the problem.
|
||||
# https://github.com/grpc/grpc/issues/22491
|
||||
cpp_test = subprocess.Popen(
|
||||
['c++', '-x', 'c++', '-std=c++11', '-latomic', '-'],
|
||||
[cxx, '-x', 'c++', '-std=c++11', '-latomic', '-'],
|
||||
stdin=PIPE,
|
||||
stdout=PIPE,
|
||||
stderr=PIPE)
|
||||
|
|
|
|||
Loading…
Reference in New Issue